@@ -38,7 +38,7 @@ getJasmineRequireObj().Any = function(j$) {
|
||||
};
|
||||
|
||||
Any.prototype.jasmineToString = function() {
|
||||
return '<jasmine.any(' + j$.fnNameFor(this.expectedObject) + ')>';
|
||||
return '<jasmine.any(' + j$.private.fnNameFor(this.expectedObject) + ')>';
|
||||
};
|
||||
|
||||
return Any;
|
||||
|
||||
@@ -4,10 +4,10 @@ getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||
}
|
||||
|
||||
ArrayContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
if (!j$.isArray_(this.sample)) {
|
||||
if (!j$.private.isArray(this.sample)) {
|
||||
throw new Error(
|
||||
'You must provide an array to arrayContaining, not ' +
|
||||
j$.basicPrettyPrinter_(this.sample) +
|
||||
j$.private.basicPrettyPrinter(this.sample) +
|
||||
'.'
|
||||
);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ getJasmineRequireObj().ArrayContaining = function(j$) {
|
||||
// If the actual parameter is not an array, we can fail immediately, since it couldn't
|
||||
// possibly be an "array containing" anything. However, we also want an empty sample
|
||||
// array to match anything, so we need to double-check we aren't in that case
|
||||
if (!j$.isArray_(other) && this.sample.length > 0) {
|
||||
if (!j$.private.isArray(other) && this.sample.length > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ getJasmineRequireObj().ArrayWithExactContents = function(j$) {
|
||||
other,
|
||||
matchersUtil
|
||||
) {
|
||||
if (!j$.isArray_(this.sample)) {
|
||||
if (!j$.private.isArray(this.sample)) {
|
||||
throw new Error(
|
||||
'You must provide an array to arrayWithExactContents, not ' +
|
||||
j$.basicPrettyPrinter_(this.sample) +
|
||||
j$.private.basicPrettyPrinter(this.sample) +
|
||||
'.'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,19 @@ getJasmineRequireObj().Empty = function(j$) {
|
||||
function Empty() {}
|
||||
|
||||
Empty.prototype.asymmetricMatch = function(other) {
|
||||
if (j$.isString_(other) || j$.isArray_(other) || j$.isTypedArray_(other)) {
|
||||
if (
|
||||
j$.private.isString(other) ||
|
||||
j$.private.isArray(other) ||
|
||||
j$.private.isTypedArray(other)
|
||||
) {
|
||||
return other.length === 0;
|
||||
}
|
||||
|
||||
if (j$.isMap(other) || j$.isSet(other)) {
|
||||
if (j$.private.isMap(other) || j$.private.isSet(other)) {
|
||||
return other.size === 0;
|
||||
}
|
||||
|
||||
if (j$.isObject_(other)) {
|
||||
if (j$.private.isObject(other)) {
|
||||
return Object.keys(other).length === 0;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
getJasmineRequireObj().MapContaining = function(j$) {
|
||||
function MapContaining(sample) {
|
||||
if (!j$.isMap(sample)) {
|
||||
if (!j$.private.isMap(sample)) {
|
||||
throw new Error(
|
||||
'You must provide a map to `mapContaining`, not ' +
|
||||
j$.basicPrettyPrinter_(sample)
|
||||
j$.private.basicPrettyPrinter(sample)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ getJasmineRequireObj().MapContaining = function(j$) {
|
||||
}
|
||||
|
||||
MapContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
if (!j$.isMap(other)) {
|
||||
if (!j$.private.isMap(other)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,15 +2,19 @@ getJasmineRequireObj().NotEmpty = function(j$) {
|
||||
function NotEmpty() {}
|
||||
|
||||
NotEmpty.prototype.asymmetricMatch = function(other) {
|
||||
if (j$.isString_(other) || j$.isArray_(other) || j$.isTypedArray_(other)) {
|
||||
if (
|
||||
j$.private.isString(other) ||
|
||||
j$.private.isArray(other) ||
|
||||
j$.private.isTypedArray(other)
|
||||
) {
|
||||
return other.length !== 0;
|
||||
}
|
||||
|
||||
if (j$.isMap(other) || j$.isSet(other)) {
|
||||
if (j$.private.isMap(other) || j$.private.isSet(other)) {
|
||||
return other.size !== 0;
|
||||
}
|
||||
|
||||
if (j$.isObject_(other)) {
|
||||
if (j$.private.isObject(other)) {
|
||||
return Object.keys(other).length !== 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ getJasmineRequireObj().ObjectContaining = function(j$) {
|
||||
};
|
||||
|
||||
ObjectContaining.prototype.valuesForDiff_ = function(other, pp) {
|
||||
if (!j$.isObject_(other)) {
|
||||
if (!j$.private.isObject(other)) {
|
||||
return {
|
||||
self: this.jasmineToString(pp),
|
||||
other: other
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
getJasmineRequireObj().SetContaining = function(j$) {
|
||||
function SetContaining(sample) {
|
||||
if (!j$.isSet(sample)) {
|
||||
if (!j$.private.isSet(sample)) {
|
||||
throw new Error(
|
||||
'You must provide a set to `setContaining`, not ' +
|
||||
j$.basicPrettyPrinter_(sample)
|
||||
j$.private.basicPrettyPrinter(sample)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ getJasmineRequireObj().SetContaining = function(j$) {
|
||||
}
|
||||
|
||||
SetContaining.prototype.asymmetricMatch = function(other, matchersUtil) {
|
||||
if (!j$.isSet(other)) {
|
||||
if (!j$.private.isSet(other)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
getJasmineRequireObj().StringContaining = function(j$) {
|
||||
function StringContaining(expected) {
|
||||
if (!j$.isString_(expected)) {
|
||||
if (!j$.private.isString(expected)) {
|
||||
throw new Error('Expected is not a String');
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ getJasmineRequireObj().StringContaining = function(j$) {
|
||||
}
|
||||
|
||||
StringContaining.prototype.asymmetricMatch = function(other) {
|
||||
if (!j$.isString_(other)) {
|
||||
if (!j$.private.isString(other)) {
|
||||
// Arrays, etc. don't match no matter what their indexOf returns.
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
getJasmineRequireObj().StringMatching = function(j$) {
|
||||
function StringMatching(expected) {
|
||||
if (!j$.isString_(expected) && !j$.isA_('RegExp', expected)) {
|
||||
if (!j$.private.isString(expected) && !j$.private.isA('RegExp', expected)) {
|
||||
throw new Error('Expected is not a String or a RegExp');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user