From 7ae3fa9fefc66b943059e687b46fd8ea74c560a2 Mon Sep 17 00:00:00 2001 From: "Davis W. Frank" Date: Mon, 10 Jun 2013 22:45:04 -0700 Subject: [PATCH] Fixed some specs that were not referring to the correct instance of Jasmine --- spec/core/matchers/toContainSpec.js | 4 ++-- spec/core/matchers/toEqualSpec.js | 4 ++-- spec/core/matchers/toHaveBeenCalledSpec.js | 8 ++++---- spec/core/matchers/toHaveBeenCalledWithSpec.js | 14 +++++++------- spec/core/matchers/toThrowErrorSpec.js | 16 ++++++++-------- spec/core/matchers/toThrowSpec.js | 8 ++++---- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/spec/core/matchers/toContainSpec.js b/spec/core/matchers/toContainSpec.js index 93635e1e..c9443f54 100644 --- a/spec/core/matchers/toContainSpec.js +++ b/spec/core/matchers/toContainSpec.js @@ -1,7 +1,7 @@ describe("toContain", function() { it("delegates to j$.matchersUtil.contains", function() { var util = { - contains: j$.createSpy('delegated-contains').andReturn(true) + contains: jasmine.createSpy('delegated-contains').andReturn(true) }, matcher = j$.matchers.toContain(util); @@ -12,7 +12,7 @@ describe("toContain", function() { it("delegates to j$.matchersUtil.contains, passing in equality testers if present", function() { var util = { - contains: j$.createSpy('delegated-contains').andReturn(true) + contains: jasmine.createSpy('delegated-contains').andReturn(true) }, customEqualityTesters = ['a', 'b'], matcher = j$.matchers.toContain(util, customEqualityTesters); diff --git a/spec/core/matchers/toEqualSpec.js b/spec/core/matchers/toEqualSpec.js index b5717f97..d7f4c415 100644 --- a/spec/core/matchers/toEqualSpec.js +++ b/spec/core/matchers/toEqualSpec.js @@ -1,7 +1,7 @@ describe("toEqual", function() { it("delegates to equals function", function() { var util = { - equals: j$.createSpy('delegated-equals').andReturn(true) + equals: jasmine.createSpy('delegated-equals').andReturn(true) }, matcher = j$.matchers.toEqual(util), result; @@ -14,7 +14,7 @@ describe("toEqual", function() { it("delegates custom equality testers, if present", function() { var util = { - equals: j$.createSpy('delegated-equals').andReturn(true) + equals: jasmine.createSpy('delegated-equals').andReturn(true) }, customEqualityTesters = ['a', 'b'], matcher = j$.matchers.toEqual(util, customEqualityTesters), diff --git a/spec/core/matchers/toHaveBeenCalledSpec.js b/spec/core/matchers/toHaveBeenCalledSpec.js index 88c8d4a7..947d0e96 100644 --- a/spec/core/matchers/toHaveBeenCalledSpec.js +++ b/spec/core/matchers/toHaveBeenCalledSpec.js @@ -1,7 +1,7 @@ describe("toHaveBeenCalled", function() { it("passes when the actual was called, with a custom .not fail message", function() { var matcher = j$.matchers.toHaveBeenCalled(), - calledSpy = j$.createSpy('called-spy'), + calledSpy = jasmine.createSpy('called-spy'), result; calledSpy(); @@ -13,7 +13,7 @@ describe("toHaveBeenCalled", function() { it("fails when the actual was not called", function() { var matcher = j$.matchers.toHaveBeenCalled(), - uncalledSpy = j$.createSpy('uncalled spy'); + uncalledSpy = jasmine.createSpy('uncalled spy'); result = matcher.compare(uncalledSpy); expect(result.pass).toBe(false); @@ -28,14 +28,14 @@ describe("toHaveBeenCalled", function() { it("throws an exception when invoked with any arguments", function() { var matcher = j$.matchers.toHaveBeenCalled(), - spy = j$.createSpy('sample spy'); + spy = jasmine.createSpy('sample spy'); expect(function() { matcher.compare(spy, 'foo') }).toThrow(new Error("toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith")); }); it("has a custom message on failure", function() { var matcher = j$.matchers.toHaveBeenCalled(), - spy = j$.createSpy('sample-spy'), + spy = jasmine.createSpy('sample-spy'), result; result = matcher.compare(spy); diff --git a/spec/core/matchers/toHaveBeenCalledWithSpec.js b/spec/core/matchers/toHaveBeenCalledWithSpec.js index 25b08d2a..5d98479f 100644 --- a/spec/core/matchers/toHaveBeenCalledWithSpec.js +++ b/spec/core/matchers/toHaveBeenCalledWithSpec.js @@ -1,10 +1,10 @@ describe("toHaveBeenCalledWith", function() { it("passes when the actual was called with matching parameters", function() { var util = { - contains: j$.createSpy('delegated-contains').andReturn(true) + contains: jasmine.createSpy('delegated-contains').andReturn(true) }, matcher = j$.matchers.toHaveBeenCalledWith(util), - calledSpy = j$.createSpy('called-spy'), + calledSpy = jasmine.createSpy('called-spy'), result; calledSpy('a', 'b'); @@ -15,10 +15,10 @@ describe("toHaveBeenCalledWith", function() { it("fails when the actual was not called", function() { var util = { - contains: j$.createSpy('delegated-contains').andReturn(false) + contains: jasmine.createSpy('delegated-contains').andReturn(false) }, matcher = j$.matchers.toHaveBeenCalledWith(util), - uncalledSpy = j$.createSpy('uncalled spy'), + uncalledSpy = jasmine.createSpy('uncalled spy'), result; result = matcher.compare(uncalledSpy); @@ -27,10 +27,10 @@ describe("toHaveBeenCalledWith", function() { it("fails when the actual was called with different parameters", function() { var util = { - contains: j$.createSpy('delegated-contains').andReturn(false) + contains: jasmine.createSpy('delegated-contains').andReturn(false) }, matcher = j$.matchers.toHaveBeenCalledWith(util), - calledSpy = j$.createSpy('called spy'), + calledSpy = jasmine.createSpy('called spy'), result; calledSpy('a'); @@ -48,7 +48,7 @@ describe("toHaveBeenCalledWith", function() { it("has a custom message on failure", function() { var matcher = j$.matchers.toHaveBeenCalledWith(), - spy = j$.createSpy('sample-spy'), + spy = jasmine.createSpy('sample-spy'), messages = matcher.message(spy); expect(messages.affirmative).toEqual("Expected spy sample-spy to have been called.") diff --git a/spec/core/matchers/toThrowErrorSpec.js b/spec/core/matchers/toThrowErrorSpec.js index dda3df97..2b26bae0 100644 --- a/spec/core/matchers/toThrowErrorSpec.js +++ b/spec/core/matchers/toThrowErrorSpec.js @@ -144,7 +144,7 @@ describe("toThrowError", function() { it("passes if thrown is an Error and the expected the same Error", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrowError(util), fn = function() { @@ -160,7 +160,7 @@ describe("toThrowError", function() { it("passes if thrown is a custom error that takes arguments and the expected is the same error", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrowError(util), CustomError = function CustomError(arg) { arg.x }, @@ -180,7 +180,7 @@ describe("toThrowError", function() { it("fails if thrown is an Error and the expected is a different Error", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(false) + equals: jasmine.createSpy('delegated-equal').andReturn(false) }, matcher = j$.matchers.toThrowError(util), fn = function() { @@ -196,7 +196,7 @@ describe("toThrowError", function() { it("passes if thrown is an Error and it is equal to the expected Error and message", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrowError(util), fn = function() { @@ -212,7 +212,7 @@ describe("toThrowError", function() { it("passes if thrown is a custom error that takes arguments and it is equal to the expected custom error and message", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrowError(util), CustomError = function CustomError(arg) { this.message = arg.message }, @@ -232,7 +232,7 @@ describe("toThrowError", function() { it("fails if thrown is an Error and the expected is a different Error", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(false) + equals: jasmine.createSpy('delegated-equal').andReturn(false) }, matcher = j$.matchers.toThrowError(util), fn = function() { @@ -248,7 +248,7 @@ describe("toThrowError", function() { it("passes if thrown is an Error and has the same type as the expected Error and the message matches the exepcted message", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrowError(util), fn = function() { @@ -264,7 +264,7 @@ describe("toThrowError", function() { it("fails if thrown is an Error and the expected is a different Error", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(false) + equals: jasmine.createSpy('delegated-equal').andReturn(false) }, matcher = j$.matchers.toThrowError(util), fn = function() { diff --git a/spec/core/matchers/toThrowSpec.js b/spec/core/matchers/toThrowSpec.js index 5c93b85c..7ba205c3 100644 --- a/spec/core/matchers/toThrowSpec.js +++ b/spec/core/matchers/toThrowSpec.js @@ -22,7 +22,7 @@ describe("toThrow", function() { it("passes if it throws but there is no expected", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrow(util), fn = function() { @@ -50,7 +50,7 @@ describe("toThrow", function() { it("passes if what is thrown is equivalent to what is expected", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(true) + equals: jasmine.createSpy('delegated-equal').andReturn(true) }, matcher = j$.matchers.toThrow(util), fn = function() { @@ -66,7 +66,7 @@ describe("toThrow", function() { it("fails if what is thrown is not equivalent to what is expected", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(false) + equals: jasmine.createSpy('delegated-equal').andReturn(false) }, matcher = j$.matchers.toThrow(util), fn = function() { @@ -82,7 +82,7 @@ describe("toThrow", function() { it("fails if what is thrown is not equivalent to undefined", function() { var util = { - equals: j$.createSpy('delegated-equal').andReturn(false) + equals: jasmine.createSpy('delegated-equal').andReturn(false) }, matcher = j$.matchers.toThrow(util), fn = function() {