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 +4 -4
- data/lib/sinon/chai/rails/version.rb +1 -1
- data/vendor/assets/javascripts/sinon-chai.js +28 -14
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82fc97110fdd4686bbdea1b768e9682fb403b959
|
4
|
+
data.tar.gz: '08e2fcb9299d6ea1f735c0680a56911a66ec72f6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd366d6ba6c75c93abcd4f56ed9ffb31e7c980b20baa699a64cdeaea16656f9220f2f07a704dc8ea031b029680bd9d80118c5b15a54a97a7227bdb3156abf2c0
|
7
|
+
data.tar.gz: 00e0a660f3be548b104dd2bace6f66a2e97949defb9a01378d4e64c7e130b47f9d3b05d2cc23c8e444e359838ed794c908357ee2d3400adcca9edb3364693997
|
@@ -1,6 +1,7 @@
|
|
1
|
-
|
2
|
-
|
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
|
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
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
102
|
+
var sinonMethodName = shouldBeAlways ? alwaysSinonMethod : sinonName;
|
93
103
|
|
94
104
|
var messages = getMessages(this._obj, action, nonNegatedSuffix, shouldBeAlways, slice.call(arguments));
|
95
|
-
this.assert(
|
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 %*", "%
|
129
|
-
sinonMethod("calledWithExactly", "been called with exact arguments %*", "%
|
130
|
-
sinonMethod("calledWithMatch", "been called with arguments matching %*", "%
|
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.
|
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-
|
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.
|
63
|
+
rubygems_version: 2.6.11
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: sinon-chai.js via asset pipeline
|