sinon-chai-rails 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f08ff7f52720d28bcbfb450706cac620d920735e
4
- data.tar.gz: bb6bcff60a34b98eaeee87eb9dc7255b1fe80c1d
3
+ metadata.gz: 82fc97110fdd4686bbdea1b768e9682fb403b959
4
+ data.tar.gz: '08e2fcb9299d6ea1f735c0680a56911a66ec72f6'
5
5
  SHA512:
6
- metadata.gz: 6178a79973646e7f0ffa5e5df3e7e6d66d1428a77f0a36c73474a9c15275f19d2440d9f6c07921e2d19697cb99ae65b57e6e41011b2e97c32396d59ed268b621
7
- data.tar.gz: 1d718ae0f34342ed165d4ef05cd5db27839d26c4683cbb1202c56aba24b3a6c07677ef4e757537cd51c370de8eb97b34aed1bdd90063d62574a73d955233db87
6
+ metadata.gz: bd366d6ba6c75c93abcd4f56ed9ffb31e7c980b20baa699a64cdeaea16656f9220f2f07a704dc8ea031b029680bd9d80118c5b15a54a97a7227bdb3156abf2c0
7
+ data.tar.gz: 00e0a660f3be548b104dd2bace6f66a2e97949defb9a01378d4e64c7e130b47f9d3b05d2cc23c8e444e359838ed794c908357ee2d3400adcca9edb3364693997
@@ -1,7 +1,7 @@
1
1
  module Sinon
2
2
  module Chai
3
3
  module Rails
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
6
6
  end
7
7
  end
@@ -1,6 +1,7 @@
1
- (function (sinonChai) {
2
- "use strict";
1
+ "use strict";
2
+ /* eslint-disable no-invalid-this */
3
3
 
4
+ (function (sinonChai) {
4
5
  // Module systems magic dance.
5
6
 
6
7
  /* istanbul ignore else */
@@ -14,11 +15,10 @@
14
15
  });
15
16
  } else {
16
17
  // Other environment (usually <script> tag): plug in to global chai instance directly.
18
+ /* global chai: false */
17
19
  chai.use(sinonChai);
18
20
  }
19
- }(function sinonChai(chai, utils) {
20
- "use strict";
21
-
21
+ }(function (chai, utils) {
22
22
  var slice = Array.prototype.slice;
23
23
 
24
24
  function isSpy(putativeSpy) {
@@ -28,10 +28,20 @@
28
28
  }
29
29
 
30
30
  function timesInWords(count) {
31
- return count === 1 ? "once" :
32
- count === 2 ? "twice" :
33
- count === 3 ? "thrice" :
34
- (count || 0) + " times";
31
+ switch (count) {
32
+ case 1: {
33
+ return "once";
34
+ }
35
+ case 2: {
36
+ return "twice";
37
+ }
38
+ case 3: {
39
+ return "thrice";
40
+ }
41
+ default: {
42
+ return (count || 0) + " times";
43
+ }
44
+ }
35
45
  }
36
46
 
37
47
  function isCall(putativeCall) {
@@ -89,10 +99,14 @@
89
99
 
90
100
  var alwaysSinonMethod = "always" + sinonName[0].toUpperCase() + sinonName.substring(1);
91
101
  var shouldBeAlways = utils.flag(this, "always") && typeof this._obj[alwaysSinonMethod] === "function";
92
- var sinonMethod = shouldBeAlways ? alwaysSinonMethod : sinonName;
102
+ var sinonMethodName = shouldBeAlways ? alwaysSinonMethod : sinonName;
93
103
 
94
104
  var messages = getMessages(this._obj, action, nonNegatedSuffix, shouldBeAlways, slice.call(arguments));
95
- this.assert(this._obj[sinonMethod].apply(this._obj, arguments), messages.affirmative, messages.negative);
105
+ this.assert(
106
+ this._obj[sinonMethodName].apply(this._obj, arguments),
107
+ messages.affirmative,
108
+ messages.negative
109
+ );
96
110
  };
97
111
  }
98
112
 
@@ -125,9 +139,9 @@
125
139
  sinonMethod("calledImmediatelyBefore", "been called immediately before %1");
126
140
  sinonMethod("calledImmediatelyAfter", "been called immediately after %1");
127
141
  sinonMethod("calledOn", "been called with %1 as this", ", but it was called with %t instead");
128
- sinonMethod("calledWith", "been called with arguments %*", "%C");
129
- sinonMethod("calledWithExactly", "been called with exact arguments %*", "%C");
130
- sinonMethod("calledWithMatch", "been called with arguments matching %*", "%C");
142
+ sinonMethod("calledWith", "been called with arguments %*", "%D");
143
+ sinonMethod("calledWithExactly", "been called with exact arguments %*", "%D");
144
+ sinonMethod("calledWithMatch", "been called with arguments matching %*", "%D");
131
145
  sinonMethod("returned", "returned %1");
132
146
  exceptionalSinonMethod("thrown", "threw", "thrown %1");
133
147
  }));
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinon-chai-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cymen Vig
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-01 00:00:00.000000000 Z
11
+ date: 2017-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
60
  version: '0'
61
61
  requirements: []
62
62
  rubyforge_project:
63
- rubygems_version: 2.6.4
63
+ rubygems_version: 2.6.11
64
64
  signing_key:
65
65
  specification_version: 4
66
66
  summary: sinon-chai.js via asset pipeline