Sha256: 54ca703c348e00826d93033f26a1317d59ca57e62987d7133abbc3f82290820b

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

describe("Any", function() {
  it("matches a string", function() {
    var any = new j$.Any(String);

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

  it("matches a number", function() {
    var any = new j$.Any(Number);

    expect(any.asymmetricMatch(1)).toBe(true);
  });

  it("matches a function", function() {
    var any = new j$.Any(Function);

    expect(any.asymmetricMatch(function(){})).toBe(true);
  });

  it("matches an Object", function() {
    var any = new j$.Any(Object);

    expect(any.asymmetricMatch({})).toBe(true);
  });

  it("matches a Boolean", function() {
    var any = new j$.Any(Boolean);

    expect(any.asymmetricMatch(true)).toBe(true);
  });

  it("matches another constructed object", function() {
    var Thing = function() {},
      any = new j$.Any(Thing);

    expect(any.asymmetricMatch(new Thing())).toBe(true);
  });

  it("jasmineToString's itself", function() {
    var any = new j$.Any(Number);

    expect(any.jasmineToString()).toEqual('<jasmine.any(Number)>');
  });

});

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jasmine-core-2.3.4 ./lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js
jasmine-core-2.3.3 ./lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js
jasmine-core-2.3.2 ./lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js
jasmine-core-2.3.0 ./lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js