Squashed matchers refactor - matchers now unit-testable apart from Expectation and Spec.

This commit is contained in:
Davis W. Frank
2013-05-28 16:54:01 -07:00
parent aca43bd3a3
commit 5700ace2c9
16 changed files with 1949 additions and 1719 deletions

39
spec/core/AnySpec.js Normal file
View File

@@ -0,0 +1,39 @@
describe("Any", function() {
it("matches a string", function() {
var any = new j$.Any(String);
expect(any.jasmineMatches("foo")).toBe(true);
});
it("matches a number", function() {
var any = new j$.Any(Number);
expect(any.jasmineMatches(1)).toBe(true);
});
it("matches a function", function() {
var any = new j$.Any(Function);
expect(any.jasmineMatches(function(){})).toBe(true);
});
it("matches an Object", function() {
var any = new j$.Any(Object);
expect(any.jasmineMatches({})).toBe(true);
});
it("matches another constructed object", function() {
var Thing = function() {},
any = new j$.Any(Thing);
expect(any.jasmineMatches(new Thing())).toBe(true);
});
it("jasmineToString's itself", function() {
var any = new j$.Any(Number);
expect(any.jasmineToString()).toMatch('<jasmine.any');
});
});