janitor_rails 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -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(val1, val2) {
57
- return this.storeAssert('equal', val1 === val2, {
58
- val1: val1,
59
- val2: val2
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
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-10 00:00:00.000000000 Z
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