Add toBeGreatThanOrEqual and toBeLessThanOrEqual matchers

- Implements issue #1013
This commit is contained in:
Patrizio Rullo
2016-02-18 00:03:06 +01:00
parent 342f0eb9a3
commit b7d8b0de71
5 changed files with 88 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ getJasmineRequireObj().requireMatchers = function(jRequire, j$) {
'toBeDefined',
'toBeFalsy',
'toBeGreaterThan',
'toBeGreaterThanOrEqual',
'toBeLessThanOrEqual',
'toBeLessThan',
'toBeNaN',
'toBeNull',

View File

@@ -0,0 +1,14 @@
getJasmineRequireObj().toBeGreaterThanOrEqual = function() {
function toBeGreaterThanOrEqual() {
return {
compare: function(actual, expected) {
return {
pass: actual >= expected
};
}
};
}
return toBeGreaterThanOrEqual;
};

View File

@@ -0,0 +1,14 @@
getJasmineRequireObj().toBeLessThanOrEqual = function() {
function toBeLessThanOrEqual() {
return {
compare: function(actual, expected) {
return {
pass: actual <= expected
};
}
};
}
return toBeLessThanOrEqual;
};