gusto 1.0.0.beta13 → 1.0.0.beta14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/Spec/DSL.coffee +2 -2
- data/lib/Spec/Matchers.coffee +8 -8
- data/lib/gusto/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aca9cea8b1abeda163c9bf46333ccb2ae2a3bd4c
|
4
|
+
data.tar.gz: 31e50947ce1983c5dcb37355c1fddf4245a7b39f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e8e7fe4ee8f830f4922d3f086a6bbc1cec598ee771078d095c4aee1134dae6a8589484d3df9b47d96dd82fc284ca94820a7386f4673b5c04f2de54c73b08c10
|
7
|
+
data.tar.gz: 60f8921a10e52f2e2e1d3bb7d7abea11139ec1dc3dcab2f402c0459a51d6919d9c72c1fbbe29fe961702a4ca6ba05c5ed874f46197079b53873b43fcf6eaf1de
|
data/lib/Spec/DSL.coffee
CHANGED
@@ -20,12 +20,12 @@ window.Spec.DSL = DSL =
|
|
20
20
|
# matcher function
|
21
21
|
to: (matcher) ->
|
22
22
|
match = matcher(object)
|
23
|
-
throw new Spec.ExpectationError("expected #{match.description}") unless match.result
|
23
|
+
throw new Spec.ExpectationError("expected #{match.description()}") unless match.result
|
24
24
|
|
25
25
|
# Specifies that the object should receive a negative response
|
26
26
|
notTo: (matcher) ->
|
27
27
|
match = matcher(object)
|
28
|
-
throw new Spec.ExpectationError("expected not #{match.description}") if match.result
|
28
|
+
throw new Spec.ExpectationError("expected not #{match.description()}") if match.result
|
29
29
|
|
30
30
|
# Sets up a stub on the given method, with a delayed expectation that this
|
31
31
|
# stub method be called
|
data/lib/Spec/Matchers.coffee
CHANGED
@@ -5,7 +5,7 @@ window.Spec.Matchers =
|
|
5
5
|
be: (expected) ->
|
6
6
|
(value) ->
|
7
7
|
result: value is expected
|
8
|
-
description: "be #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}"
|
8
|
+
description: -> "be #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}"
|
9
9
|
|
10
10
|
# Tests that value type matches specified class
|
11
11
|
beA: (klass) ->
|
@@ -21,7 +21,7 @@ window.Spec.Matchers =
|
|
21
21
|
equal: (expected) ->
|
22
22
|
(value) ->
|
23
23
|
result: String(value) == String(expected)
|
24
|
-
description: "equal “#{String expected}”, actual “#{String value}” – #{$.trim diffString(String(value), String(expected))}"
|
24
|
+
description: -> "equal “#{String expected}”, actual “#{String value}” – #{$.trim diffString(String(value), String(expected))}"
|
25
25
|
|
26
26
|
# All-purpose inclusion matcher
|
27
27
|
include: (expected) ->
|
@@ -31,7 +31,7 @@ window.Spec.Matchers =
|
|
31
31
|
for test in expected
|
32
32
|
match = false unless (value.indexOf && value.indexOf(test) >= 0) || value[test]?
|
33
33
|
result: match
|
34
|
-
description: "include #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}"
|
34
|
+
description: -> "include #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}"
|
35
35
|
else if typeof expected == 'object'
|
36
36
|
(value) ->
|
37
37
|
missing = {}
|
@@ -42,7 +42,7 @@ window.Spec.Matchers =
|
|
42
42
|
match = false
|
43
43
|
missing[test] = expected[test]
|
44
44
|
result: match
|
45
|
-
description: "include #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}, missing #{Spec.Util.inspect missing}"
|
45
|
+
description: -> "include #{Spec.Util.inspect expected}, actual #{Spec.Util.inspect value}, missing #{Spec.Util.inspect missing}"
|
46
46
|
else
|
47
47
|
include([expected])
|
48
48
|
|
@@ -56,10 +56,10 @@ window.Spec.Matchers =
|
|
56
56
|
thrown = e.message
|
57
57
|
if thrown
|
58
58
|
result: thrown == message
|
59
|
-
description: "throw an error with message “#{String thrown}”, actual message “#{String message}” – #{$.trim diffString(String(thrown), String(message))}"
|
59
|
+
description: -> "throw an error with message “#{String thrown}”, actual message “#{String message}” – #{$.trim diffString(String(thrown), String(message))}"
|
60
60
|
else
|
61
61
|
result: false
|
62
|
-
description: "throw an error with message “#{message}”, no error thrown"
|
62
|
+
description: -> "throw an error with message “#{message}”, no error thrown"
|
63
63
|
|
64
64
|
# Tests a value type using typeof, falling back to instanceof if type is an object
|
65
65
|
_haveType: (type, klass) ->
|
@@ -68,12 +68,12 @@ window.Spec.Matchers =
|
|
68
68
|
@_beAnInstanceOf(klass)(value)
|
69
69
|
else
|
70
70
|
result: typeof value is type
|
71
|
-
description: "to have type “#{type}”, actual “#{typeof value}”"
|
71
|
+
description: -> "to have type “#{type}”, actual “#{typeof value}”"
|
72
72
|
|
73
73
|
# Tests if matched value is an instance of class
|
74
74
|
_beAnInstanceOf: (klass) ->
|
75
75
|
(value) ->
|
76
76
|
result: value instanceof klass
|
77
|
-
description: "#{value} to be an instance of “#{klass.name || klass}”, actually “#{Spec.Util.inspectClass value}"
|
77
|
+
description: -> "#{value} to be an instance of “#{klass.name || klass}”, actually “#{Spec.Util.inspectClass value}"
|
78
78
|
|
79
79
|
window.Spec.Matchers.beAn = window.Spec.Matchers.beA
|
data/lib/gusto/version.rb
CHANGED