Sha256: 38d82840b73661676d2387af6f24989debfeabc9a3af7c0697ffd10a287e7dfa

Contents?: true

Size: 1.29 KB

Versions: 40

Compression:

Stored size: 1.29 KB

Contents

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

  function toHaveBeenCalledWith(util, customEqualityTesters) {
    return {
      compare: function() {
        var args = Array.prototype.slice.call(arguments, 0),
          actual = args[0],
          expectedArgs = args.slice(1),
          result = { pass: false };

        if (!j$.isSpy(actual)) {
          throw new Error('Expected a spy, but got ' + j$.pp(actual) + '.');
        }

        if (!actual.calls.any()) {
          result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but it was never called.'; };
          return result;
        }

        if (util.contains(actual.calls.allArgs(), expectedArgs, customEqualityTesters)) {
          result.pass = true;
          result.message = function() { return 'Expected spy ' + actual.and.identity() + ' not to have been called with ' + j$.pp(expectedArgs) + ' but it was.'; };
        } else {
          result.message = function() { return 'Expected spy ' + actual.and.identity() + ' to have been called with ' + j$.pp(expectedArgs) + ' but actual calls were ' + j$.pp(actual.calls.allArgs()).replace(/^\[ | \]$/g, '') + '.'; };
        }

        return result;
      }
    };
  }

  return toHaveBeenCalledWith;
};

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/matchers/toHaveBeenCalledWith.js
upjs-rails-0.11.0 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.5 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.4 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.3 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.2 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.1 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.10.0 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.9.1 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.9.0 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.8.2 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.8.1 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.8.0 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.8 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.7 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.6 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.5 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.4 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.3 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js
upjs-rails-0.7.2 spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js