konacha-chai-matchers 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  module Konacha
2
2
  module Chai
3
3
  module Matchers
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  end
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  chai.Assertion.addMethod('when', function(val, options) {
25
- var action, definedActions, done, object, promiseCallback, result, _i, _j, _len, _len1,
25
+ var action, definedActions, done, newPromise, object, promiseCallback, result, _i, _j, _len, _len1,
26
26
  _this = this;
27
27
  if (options == null) {
28
28
  options = {};
@@ -37,7 +37,6 @@
37
37
  }
38
38
  }
39
39
  result = val();
40
- flag(this, 'object', result);
41
40
  if ((result != null ? result.then : void 0) != null) {
42
41
  done = options != null ? options.notify : void 0;
43
42
  if (done == null) {
@@ -58,7 +57,8 @@
58
57
  throw new Error(error);
59
58
  }
60
59
  };
61
- result.then(promiseCallback, promiseCallback);
60
+ newPromise = result.then(promiseCallback, promiseCallback);
61
+ flag(this, 'object', newPromise);
62
62
  } else {
63
63
  for (_j = 0, _len1 = definedActions.length; _j < _len1; _j++) {
64
64
  action = definedActions[_j];
@@ -66,7 +66,9 @@
66
66
  action.after(this);
67
67
  }
68
68
  }
69
+ flag(this, 'object', result);
69
70
  }
71
+ flag(this, 'negate', false);
70
72
  return this;
71
73
  });
72
74
  noChangeAssert = function(context) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: konacha-chai-matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
61
61
  version: '0'
62
62
  requirements: []
63
63
  rubyforge_project: konacha-chai-matchers
64
- rubygems_version: 1.8.23
64
+ rubygems_version: 1.8.15
65
65
  signing_key:
66
66
  specification_version: 3
67
67
  summary: Chai.js plugins collection for Konacha