Rename j$ to jasmineUnderTest for specs

- Clarifies what it is for when writing tests
- No longer named the same as the `jasmine` that is injected into live
  code
This commit is contained in:
Gregg Van Hove
2015-12-03 17:23:32 -08:00
parent a95c2cfe3f
commit 79206ccff5
60 changed files with 702 additions and 896 deletions

View File

@@ -1,43 +1,43 @@
describe("Any", function() {
it("matches a string", function() {
var any = new j$.Any(String);
var any = new jasmineUnderTest.Any(String);
expect(any.asymmetricMatch("foo")).toBe(true);
});
it("matches a number", function() {
var any = new j$.Any(Number);
var any = new jasmineUnderTest.Any(Number);
expect(any.asymmetricMatch(1)).toBe(true);
});
it("matches a function", function() {
var any = new j$.Any(Function);
var any = new jasmineUnderTest.Any(Function);
expect(any.asymmetricMatch(function(){})).toBe(true);
});
it("matches an Object", function() {
var any = new j$.Any(Object);
var any = new jasmineUnderTest.Any(Object);
expect(any.asymmetricMatch({})).toBe(true);
});
it("matches a Boolean", function() {
var any = new j$.Any(Boolean);
var any = new jasmineUnderTest.Any(Boolean);
expect(any.asymmetricMatch(true)).toBe(true);
});
it("matches another constructed object", function() {
var Thing = function() {},
any = new j$.Any(Thing);
any = new jasmineUnderTest.Any(Thing);
expect(any.asymmetricMatch(new Thing())).toBe(true);
});
it("jasmineToString's itself", function() {
var any = new j$.Any(Number);
var any = new jasmineUnderTest.Any(Number);
expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
});
@@ -45,7 +45,7 @@ describe("Any", function() {
describe("when called without an argument", function() {
it("tells the user to pass a constructor or use jasmine.anything()", function() {
expect(function() {
new j$.Any();
new jasmineUnderTest.Any();
}).toThrowError(TypeError, /constructor.*anything/);
});
});