Remove an extra layer of wrapping for matchers/custom matchers

Helps reduce how nested custom matchers have to be for users as well as
Jasmine internal matchers

[#59161378]
This commit is contained in:
Sheel Choksi
2013-10-19 22:46:19 -07:00
parent 5f429fcb37
commit 39d7ebf28e
37 changed files with 437 additions and 494 deletions

View File

@@ -3,9 +3,9 @@ describe("toContain", function() {
var util = {
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
},
matcher = j$.matchers.toContain(util);
matcherComparator = j$.matchers.toContain(util);
result = matcher.compare("ABC", "B");
result = matcherComparator("ABC", "B");
expect(util.contains).toHaveBeenCalledWith("ABC", "B", []);
expect(result.pass).toBe(true);
});
@@ -15,9 +15,9 @@ describe("toContain", function() {
contains: jasmine.createSpy('delegated-contains').and.returnValue(true)
},
customEqualityTesters = ['a', 'b'],
matcher = j$.matchers.toContain(util, customEqualityTesters);
matcherComparator = j$.matchers.toContain(util, customEqualityTesters);
result = matcher.compare("ABC", "B");
result = matcherComparator("ABC", "B");
expect(util.contains).toHaveBeenCalledWith("ABC", "B", ['a', 'b']);
expect(result.pass).toBe(true);
});