Sha256: b8ef7137e339bf01d403968129aa51e30b9224cd1ac36b4541ffa4bdf23638ff

Contents?: true

Size: 1.16 KB

Versions: 9

Compression:

Stored size: 1.16 KB

Contents

describe("ArrayContaining", function() {
  it("matches any actual to an empty array", function() {
    var containing = new j$.ArrayContaining([]);

    expect(containing.asymmetricMatch("foo")).toBe(true);
  });

  it("does not work when not passed an array", function() {
    var containing = new j$.ArrayContaining("foo");

    expect(function() {
      containing.asymmetricMatch([]);
    }).toThrowError(/not 'foo'/);
  });

  it("matches when the item is in the actual", function() {
    var containing = new j$.ArrayContaining(["foo"]);

    expect(containing.asymmetricMatch(["foo"])).toBe(true);
  });

  it("matches when additional items are in the actual", function() {
    var containing = new j$.ArrayContaining(["foo"]);

    expect(containing.asymmetricMatch(["foo", "bar"])).toBe(true);
  });

  it("does not match when the item is not in the actual", function() {
    var containing = new j$.ArrayContaining(["foo"]);

    expect(containing.asymmetricMatch(["bar"])).toBe(false);
  });

  it("jasmineToStrings itself", function() {
    var containing = new j$.ArrayContaining([]);

    expect(containing.jasmineToString()).toMatch("<jasmine.arrayContaining");
  });
});

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
tdiary-5.0.2 vendor/bundle/gems/jasmine-core-2.4.1/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
tdiary-5.0.1 vendor/bundle/gems/jasmine-core-2.4.1/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.4.1 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.4.0 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.3.4 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.3.3 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.3.2 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.3.0 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js
jasmine-core-2.2.0 ./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js