Sha256: 9258dcb04a1bda35409e2a4deb0f1e3d15ba522cf7ae1f376b3cdbd7bfc14a03

Contents?: true

Size: 776 Bytes

Versions: 10

Compression:

Stored size: 776 Bytes

Contents

var root = this;

root.context = root.describe;
root.xcontext = root.xdescribe;

var matchers = {
  toIs: function(selector) {
    return this.actual.is(selector);
  },
  toHas: function(selector) {
    return this.actual.find(selector).length > 0;
  },
  toExist: function() {
    if(this.actual.constructor === String) {
      return $(this.actual).length > 0;
    } else {
      return $.contains(document.body,$(this.actual)[0]);
    }
  },
  toInjectProperly: function() {
    $result = affix(this.actual)
    return $(this.actual).length > 0 && $('#jasmine_content').find(this.actual).length > 0
  }
};

beforeEach(function() {
  if(jasmine.addMatchers) {
    jasmine.addMatchers(jasmine.matcherWrapper.wrap(matchers))
  } else {
    this.addMatchers(matchers)
  }
});

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hooch-0.4.2 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.4.1 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.4.0 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.3.0 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.2.1 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.2.0 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.1.0 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.0.8 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.0.7 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js
hooch-0.0.6 jasmine/jasmine-fixture-1.3.1/spec/helpers/helper.js