janitor_rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/vendor/assets/javascripts/janitor.js +19 -4
- metadata +2 -2
@@ -53,10 +53,12 @@ window.Janitor.Stitch = {};
|
|
53
53
|
return this.require.define;
|
54
54
|
}).call(this)({"assertions": function(exports, require, module) {
|
55
55
|
module.exports = {
|
56
|
-
assertEqual: function(
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
assertEqual: function(expected, actual) {
|
57
|
+
var success;
|
58
|
+
success = expected === actual;
|
59
|
+
return this.storeAssert('equal', success, {
|
60
|
+
expected: expected,
|
61
|
+
actual: actual
|
60
62
|
});
|
61
63
|
},
|
62
64
|
assert: function(exp) {
|
@@ -113,6 +115,15 @@ window.Janitor.Stitch = {};
|
|
113
115
|
return this.storeAssert('all', success, {
|
114
116
|
callback: callback
|
115
117
|
});
|
118
|
+
},
|
119
|
+
assertInDelta: function(expected, actual, delta) {
|
120
|
+
var success;
|
121
|
+
success = expected - delta < actual && expected + delta > actual;
|
122
|
+
return this.storeAssert('inDelta', success, {
|
123
|
+
expected: expected,
|
124
|
+
actual: actual,
|
125
|
+
delta: delta
|
126
|
+
});
|
116
127
|
}
|
117
128
|
};
|
118
129
|
}, "browser_presenter": function(exports, require, module) {(function() {
|
@@ -248,6 +259,10 @@ window.Janitor.Stitch = {};
|
|
248
259
|
return "" + this.options.exp + " is not true";
|
249
260
|
};
|
250
261
|
|
262
|
+
FailedAssertionMessage.prototype.inDelta = function() {
|
263
|
+
return "" + this.options.actual + " is not within " + this.options.expected + "±" + this.options.delta;
|
264
|
+
};
|
265
|
+
|
251
266
|
FailedAssertionMessage.prototype.toString = function() {
|
252
267
|
if (this[this.type]) {
|
253
268
|
return this[this.type]();
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: janitor_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: janitor_rails lets you easily test Javascript code with Janitor.
|
15
15
|
email: rasmusrnielsen@gmail.com
|