Skip to content

Commit

Permalink
Fix Matchers.any specs in Firefox
Browse files Browse the repository at this point in the history
- Firefox adds whitespace to the resulting to_string function, necessary
  to remove it for the match to occur correctly.
  • Loading branch information
ragaskar committed Apr 4, 2012
1 parent d46ca4f commit 7ad75c1
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions spec/core/MatchersSpec.js
Original file line number Diff line number Diff line change
@@ -947,36 +947,36 @@ describe("jasmine.Matchers", function() {
describe("with Object", function () {
it("says it's looking for an object", function () {
any = jasmine.any(Object);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Object.*\)>/);
expect(any.jasmineToString().replace(/\n/g, "")).toMatch(/<jasmine\.any\(function Object.*\)>/);
});
});

describe("with Function", function () {
it("says it's looking for a function", function () {
any = jasmine.any(Function);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Function.*\)>/);
expect(any.jasmineToString().replace(/\n/g, "")).toMatch(/<jasmine\.any\(function Function.*\)>/);
});
});

describe("with String", function () {
it("says it's looking for a string", function () {
any = jasmine.any(String);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function String.*\)>/);
expect(any.jasmineToString().replace(/\n/g, "")).toMatch(/<jasmine\.any\(function String.*\)>/);
});
});

describe("with Number", function () {
it("says it's looking for a number", function () {
any = jasmine.any(Number);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function Number.*\)>/);
expect(any.jasmineToString().replace(/\n/g, "")).toMatch(/<jasmine\.any\(function Number.*\)>/);
});
});

describe("with some other defined 'class'", function () {
it("says it's looking for an object", function () {
function MyClass () {}
any = jasmine.any(MyClass);
expect(any.jasmineToString()).toMatch(/<jasmine\.any\(function MyClass.*\)>/);
expect(any.jasmineToString().replace("\n", "")).toMatch(/<jasmine\.any\(function MyClass.*\)>/);
});
});
});
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@ jasmine.version_= {
"major": 1,
"minor": 2,
"build": 0,
"revision": 1333492179,
"revision": 1333553033,
"release_candidate": 2
};

0 comments on commit 7ad75c1

Please sign in to comment.