Merge branch 'master' of https://github.com/sjolicoeur/jasmine into sjolicoeur-master
- Merges #1460 from @sjolicoeur
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
getJasmineRequireObj().Empty = function (j$) {
|
||||
|
||||
function Empty() {}
|
||||
|
||||
Empty.prototype.asymmetricMatch = function (other) {
|
||||
if (j$.isString_(other) || j$.isArray_(other) || j$.isTypedArray_(other)) {
|
||||
return other.length === 0;
|
||||
}
|
||||
|
||||
if (j$.isMap(other) || j$.isSet(other)) {
|
||||
return other.size === 0;
|
||||
}
|
||||
|
||||
if (j$.isObject_(other)) {
|
||||
return Object.keys(other).length === 0;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Empty.prototype.jasmineToString = function () {
|
||||
return '<jasmine.empty>';
|
||||
};
|
||||
|
||||
return Empty;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
getJasmineRequireObj().Falsy = function(j$) {
|
||||
|
||||
function Falsy() {}
|
||||
|
||||
Falsy.prototype.asymmetricMatch = function(other) {
|
||||
return !other;
|
||||
};
|
||||
|
||||
Falsy.prototype.jasmineToString = function() {
|
||||
return '<jasmine.falsy>';
|
||||
};
|
||||
|
||||
return Falsy;
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
getJasmineRequireObj().NotEmpty = function (j$) {
|
||||
|
||||
function NotEmpty() {}
|
||||
|
||||
NotEmpty.prototype.asymmetricMatch = function (other) {
|
||||
if (j$.isString_(other) || j$.isArray_(other) || j$.isTypedArray_(other)) {
|
||||
return other.length !== 0;
|
||||
}
|
||||
|
||||
if (j$.isMap(other) || j$.isSet(other)) {
|
||||
return other.size !== 0;
|
||||
}
|
||||
|
||||
if (j$.isObject_(other)) {
|
||||
return Object.keys(other).length !== 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
NotEmpty.prototype.jasmineToString = function () {
|
||||
return '<jasmine.notEmpty>';
|
||||
};
|
||||
|
||||
return NotEmpty;
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
getJasmineRequireObj().Truthy = function(j$) {
|
||||
|
||||
function Truthy() {}
|
||||
|
||||
Truthy.prototype.asymmetricMatch = function(other) {
|
||||
return !!other;
|
||||
};
|
||||
|
||||
Truthy.prototype.jasmineToString = function() {
|
||||
return '<jasmine.truthy>';
|
||||
};
|
||||
|
||||
return Truthy;
|
||||
};
|
||||
Reference in New Issue
Block a user