diff --git a/lib/jasmine-core/jasmine.js b/lib/jasmine-core/jasmine.js index 4cd407d4..7983656a 100644 --- a/lib/jasmine-core/jasmine.js +++ b/lib/jasmine-core/jasmine.js @@ -113,7 +113,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) { j$.Falsy = jRequire.Falsy(j$); j$.Empty = jRequire.Empty(j$); j$.NotEmpty = jRequire.NotEmpty(j$); - j$.Exactly = jRequire.Exactly(j$); + j$.Is = jRequire.Is(j$); j$.matchers = jRequire.requireMatchers(jRequire, j$); j$.asyncMatchers = jRequire.requireAsyncMatchers(jRequire, j$); @@ -458,12 +458,12 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get an {@link AsymmetricEqualityTester}, usable in any {@link matchers|matcher} * that passes if the actual value is the same as the sample as determined * by the `===` operator. - * @name jasmine.exactly + * @name jasmine.is * @function * @param {Object} sample - The value to compare the actual to. */ - j$.exactly = function(sample) { - return new j$.Exactly(sample); + j$.is = function(sample) { + return new j$.Is(sample); }; /** @@ -2813,24 +2813,6 @@ getJasmineRequireObj().Empty = function(j$) { return Empty; }; -getJasmineRequireObj().Exactly = function(j$) { - class Exactly { - constructor(expected) { - this.expected_ = expected; - } - - asymmetricMatch(actual) { - return actual === this.expected_; - } - - jasmineToString(pp) { - return ``; - } - } - - return Exactly; -}; - getJasmineRequireObj().Falsy = function(j$) { function Falsy() {} @@ -2845,6 +2827,24 @@ getJasmineRequireObj().Falsy = function(j$) { return Falsy; }; +getJasmineRequireObj().Is = function(j$) { + class Is { + constructor(expected) { + this.expected_ = expected; + } + + asymmetricMatch(actual) { + return actual === this.expected_; + } + + jasmineToString(pp) { + return ``; + } + } + + return Is; +}; + getJasmineRequireObj().MapContaining = function(j$) { function MapContaining(sample) { if (!j$.isMap(sample)) { diff --git a/spec/core/SuiteSpec.js b/spec/core/SuiteSpec.js index 87b0fcfd..6cac4540 100644 --- a/spec/core/SuiteSpec.js +++ b/spec/core/SuiteSpec.js @@ -72,8 +72,8 @@ describe('Suite', function() { suite.beforeAll(innerBefore); expect(suite.beforeAllFns).toEqual([ - { fn: outerBefore.fn, type: 'beforeAll', suite: jasmine.exactly(suite) }, - { fn: innerBefore.fn, type: 'beforeAll', suite: jasmine.exactly(suite) } + { fn: outerBefore.fn, type: 'beforeAll', suite: jasmine.is(suite) }, + { fn: innerBefore.fn, type: 'beforeAll', suite: jasmine.is(suite) } ]); }); diff --git a/spec/core/asymmetric_equality/ExactlySpec.js b/spec/core/asymmetric_equality/IsSpec.js similarity index 65% rename from spec/core/asymmetric_equality/ExactlySpec.js rename to spec/core/asymmetric_equality/IsSpec.js index 371370b6..c2554aab 100644 --- a/spec/core/asymmetric_equality/ExactlySpec.js +++ b/spec/core/asymmetric_equality/IsSpec.js @@ -1,30 +1,30 @@ -describe('Exactly', function() { +describe('Is', function() { it('passes for primitives that are ===', function() { - const exactly = new jasmineUnderTest.Exactly(17); + const exactly = new jasmineUnderTest.Is(17); expect(exactly.asymmetricMatch(17)).toBeTrue(); }); it('fails for primitives that are not ===', function() { - const exactly = new jasmineUnderTest.Exactly(42); + const exactly = new jasmineUnderTest.Is(42); expect(exactly.asymmetricMatch('42')).toBeFalse(); }); it('passes for the same object instance', function() { const obj = {}; - const exactly = new jasmineUnderTest.Exactly(obj); + const exactly = new jasmineUnderTest.Is(obj); expect(exactly.asymmetricMatch(obj)).toBeTrue(); }); it('fails for different object instances, even if they are deep value equal', function() { - const exactly = new jasmineUnderTest.Exactly({}); + const exactly = new jasmineUnderTest.Is({}); expect(exactly.asymmetricMatch({})).toBeFalse(); }); it('describes itself for use in diffs and pretty printing', function() { - const exactly = new jasmineUnderTest.Exactly({ foo: ['bar'] }); + const exactly = new jasmineUnderTest.Is({ foo: ['bar'] }); const pp = jasmineUnderTest.basicPrettyPrinter_; expect(exactly.jasmineToString(pp)).toEqual( - "" + "" ); }); }); diff --git a/src/core/asymmetric_equality/Exactly.js b/src/core/asymmetric_equality/Is.js similarity index 56% rename from src/core/asymmetric_equality/Exactly.js rename to src/core/asymmetric_equality/Is.js index e748f772..0152967c 100644 --- a/src/core/asymmetric_equality/Exactly.js +++ b/src/core/asymmetric_equality/Is.js @@ -1,5 +1,5 @@ -getJasmineRequireObj().Exactly = function(j$) { - class Exactly { +getJasmineRequireObj().Is = function(j$) { + class Is { constructor(expected) { this.expected_ = expected; } @@ -9,9 +9,9 @@ getJasmineRequireObj().Exactly = function(j$) { } jasmineToString(pp) { - return ``; + return ``; } } - return Exactly; + return Is; }; diff --git a/src/core/base.js b/src/core/base.js index e9b05bb1..b04499a2 100644 --- a/src/core/base.js +++ b/src/core/base.js @@ -287,12 +287,12 @@ getJasmineRequireObj().base = function(j$, jasmineGlobal) { * Get an {@link AsymmetricEqualityTester}, usable in any {@link matchers|matcher} * that passes if the actual value is the same as the sample as determined * by the `===` operator. - * @name jasmine.exactly + * @name jasmine.is * @function * @param {Object} sample - The value to compare the actual to. */ - j$.exactly = function(sample) { - return new j$.Exactly(sample); + j$.is = function(sample) { + return new j$.Is(sample); }; /** diff --git a/src/core/requireCore.js b/src/core/requireCore.js index f0567dbc..2568134f 100644 --- a/src/core/requireCore.js +++ b/src/core/requireCore.js @@ -91,7 +91,7 @@ var getJasmineRequireObj = (function(jasmineGlobal) { j$.Falsy = jRequire.Falsy(j$); j$.Empty = jRequire.Empty(j$); j$.NotEmpty = jRequire.NotEmpty(j$); - j$.Exactly = jRequire.Exactly(j$); + j$.Is = jRequire.Is(j$); j$.matchers = jRequire.requireMatchers(jRequire, j$); j$.asyncMatchers = jRequire.requireAsyncMatchers(jRequire, j$);