Sha256: 8fd99fd63ad9eb9dc079798d6a38bcbd233a02449b5e7eaa04e30d4f6e79352c

Contents?: true

Size: 1.38 KB

Versions: 40

Compression:

Stored size: 1.38 KB

Contents

getJasmineRequireObj().ObjectContaining = function(j$) {

  function ObjectContaining(sample) {
    this.sample = sample;
  }

  ObjectContaining.prototype.jasmineMatches = function(other, mismatchKeys, mismatchValues) {
    if (typeof(this.sample) !== 'object') { throw new Error('You must provide an object to objectContaining, not \''+this.sample+'\'.'); }

    mismatchKeys = mismatchKeys || [];
    mismatchValues = mismatchValues || [];

    var hasKey = function(obj, keyName) {
      return obj !== null && !j$.util.isUndefined(obj[keyName]);
    };

    for (var property in this.sample) {
      if (!hasKey(other, property) && hasKey(this.sample, property)) {
        mismatchKeys.push('expected has key \'' + property + '\', but missing from actual.');
      }
      else if (!j$.matchersUtil.equals(other[property], this.sample[property])) {
        mismatchValues.push('\'' + property + '\' was \'' + (other[property] ? j$.util.htmlEscape(other[property].toString()) : other[property]) + '\' in actual, but was \'' + (this.sample[property] ? j$.util.htmlEscape(this.sample[property].toString()) : this.sample[property]) + '\' in expected.');
      }
    }

    return (mismatchKeys.length === 0 && mismatchValues.length === 0);
  };

  ObjectContaining.prototype.jasmineToString = function() {
    return '<jasmine.objectContaining(' + j$.pp(this.sample) + ')>';
  };

  return ObjectContaining;
};

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/bootstrap-tagsinput/lib/jasmine/src/core/ObjectContaining.js
upjs-rails-0.11.0 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.5 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.4 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.3 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.2 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.1 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.10.0 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.9.1 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.9.0 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.8.2 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.8.1 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.8.0 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.8 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.7 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.6 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.5 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.4 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.3 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js
upjs-rails-0.7.2 spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js