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

@@ -3,8 +3,8 @@ describe("toHaveBeenCalledWith", function() {
var util = {
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
},
matcher = j$.matchers.toHaveBeenCalledWith(util),
calledSpy = j$.createSpy('called-spy'),
matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util),
calledSpy = jasmineUnderTest.createSpy('called-spy'),
result;
calledSpy('a', 'b');
@@ -19,8 +19,8 @@ describe("toHaveBeenCalledWith", function() {
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
},
customEqualityTesters = [function() { return true; }],
matcher = j$.matchers.toHaveBeenCalledWith(util, customEqualityTesters),
calledSpy = j$.createSpy('called-spy');
matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util, customEqualityTesters),
calledSpy = jasmineUnderTest.createSpy('called-spy');
calledSpy('a', 'b');
matcher.compare(calledSpy, 'a', 'b');
@@ -32,8 +32,8 @@ describe("toHaveBeenCalledWith", function() {
var util = {
contains: jasmine.createSpy('delegated-contains').and.returnValue(false)
},
matcher = j$.matchers.toHaveBeenCalledWith(util),
uncalledSpy = j$.createSpy('uncalled spy'),
matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util),
uncalledSpy = jasmineUnderTest.createSpy('uncalled spy'),
result;
result = matcher.compare(uncalledSpy);
@@ -45,8 +45,8 @@ describe("toHaveBeenCalledWith", function() {
var util = {
contains: jasmine.createSpy('delegated-contains').and.returnValue(false)
},
matcher = j$.matchers.toHaveBeenCalledWith(util),
calledSpy = j$.createSpy('called spy'),
matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(util),
calledSpy = jasmineUnderTest.createSpy('called spy'),
result;
calledSpy('a');
@@ -58,7 +58,7 @@ describe("toHaveBeenCalledWith", function() {
});
it("throws an exception when the actual is not a spy", function() {
var matcher = j$.matchers.toHaveBeenCalledWith(),
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledWith(),
fn = function() {};
expect(function() { matcher.compare(fn) }).toThrow(new Error("Expected a spy, but got Function."));