Skip to content

Commit

Permalink
Fixed some specs that were not referring to the correct instance of J…
Browse files Browse the repository at this point in the history
…asmine
  • Loading branch information
Davis W. Frank committed Jun 11, 2013
1 parent e73b9e7 commit 7ae3fa9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions spec/core/matchers/toContainSpec.js
Original file line number Diff line number Diff line change
@@ -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);

Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions spec/core/matchers/toEqualSpec.js
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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),
Expand Down
8 changes: 4 additions & 4 deletions spec/core/matchers/toHaveBeenCalledSpec.js
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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);
Expand All @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions spec/core/matchers/toHaveBeenCalledWithSpec.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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);
Expand All @@ -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');
Expand All @@ -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.")
Expand Down
16 changes: 8 additions & 8 deletions spec/core/matchers/toThrowErrorSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 },
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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 },
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions spec/core/matchers/toThrowSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down

0 comments on commit 7ae3fa9

Please sign in to comment.