Added toBeLessThan and toBeGreaterThan matchers.

This commit is contained in:
Aaron Peckham & Christian Williams
2009-08-14 15:39:28 -07:00
parent 3e68a2c2bc
commit ca077342f3
3 changed files with 32 additions and 0 deletions

View File

@@ -167,6 +167,18 @@ describe("jasmine.Matchers", function() {
});
});
it("toBeLessThan should pass if actual is less than expected", function() {
expect(match(37).toBeLessThan(42)).toEqual(true);
expect(match(37).toBeLessThan(-42)).toEqual(false);
expect(match(37).toBeLessThan(37)).toEqual(false);
});
it("toBeGreaterThan should pass if actual is greater than expected", function() {
expect(match(37).toBeGreaterThan(42)).toEqual(false);
expect(match(37).toBeGreaterThan(-42)).toEqual(true);
expect(match(37).toBeGreaterThan(37)).toEqual(false);
});
it("toThrow", function() {
var expected = new jasmine.Matchers(env, function() {
throw new Error("Fake Error");