Merge pull request #392 from albertandrejev/jasmine.Any
jasmine.any Boolean support
This commit is contained in:
@@ -22,6 +22,12 @@ describe("Any", function() {
|
||||
|
||||
expect(any.jasmineMatches({})).toBe(true);
|
||||
});
|
||||
|
||||
it("matches a Boolean", function() {
|
||||
var any = new j$.Any(Boolean);
|
||||
|
||||
expect(any.jasmineMatches(true)).toBe(true);
|
||||
});
|
||||
|
||||
it("matches another constructed object", function() {
|
||||
var Thing = function() {},
|
||||
|
||||
@@ -20,6 +20,10 @@ getJasmineRequireObj().Any = function() {
|
||||
if (this.expectedObject == Object) {
|
||||
return typeof other == 'object';
|
||||
}
|
||||
|
||||
if (this.expectedObject == Boolean) {
|
||||
return typeof other == 'boolean';
|
||||
}
|
||||
|
||||
return other instanceof this.expectedObject;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user