Revert removal of compare nesting

Since we want the user to be able to pass a negative comparison function, the extra layer of wrapping is now needed
This commit is contained in:
Kyriacos Souroullas and Sheel Choksi
2013-10-28 13:49:54 -07:00
parent dd8a455f91
commit e346e7dcc1
37 changed files with 493 additions and 435 deletions

View File

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