Sha256: edb5f4edce39e8483f30805a44b4bdc6c7d00c31ef0cf433c28c827f0571beec

Contents?: true

Size: 903 Bytes

Versions: 9

Compression:

Stored size: 903 Bytes

Contents

describe("StringMatching", function() {
  it("matches a string against a provided regexp", function() {
    var matcher = new j$.StringMatching(/foo/);

    expect(matcher.asymmetricMatch('barfoobaz')).toBe(true);
    expect(matcher.asymmetricMatch('barbaz')).toBe(false);
  });

  it("matches a string against provided string", function() {
    var matcher = new j$.StringMatching('foo');

    expect(matcher.asymmetricMatch('barfoobaz')).toBe(true);
    expect(matcher.asymmetricMatch('barbaz')).toBe(false);
  });

  it("raises an Error when the expected is not a String or RegExp", function() {
    expect(function() {
      new j$.StringMatching({});
    }).toThrowError(/not a String or a RegExp/);
  });

  it("jasmineToString's itself", function() {
    var matching = new j$.StringMatching(/^foo/);

    expect(matching.jasmineToString()).toEqual("<jasmine.stringMatching(/^foo/)>");
  });
});

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/StringMatchingSpec.js
tdiary-5.0.1 vendor/bundle/gems/jasmine-core-2.4.1/lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.4.1 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.4.0 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.3.4 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.3.3 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.3.2 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.3.0 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js
jasmine-core-2.2.0 ./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js