riot 0.10.8 → 0.10.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/riot/assertion.rb +3 -3
- data/riot.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.9
|
data/lib/riot/assertion.rb
CHANGED
@@ -5,7 +5,7 @@ module Riot
|
|
5
5
|
super
|
6
6
|
@expectings, @expect_exception, @expectation_block = [], false, nil
|
7
7
|
@assertion_block = lambda do |actual|
|
8
|
-
actual ?
|
8
|
+
actual ? self.class.pass : self.class.fail("Expected non-false but got #{actual.inspect} instead")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -22,7 +22,7 @@ module Riot
|
|
22
22
|
class_eval <<-EOC
|
23
23
|
def #{name}(*expectings, &expectation_block)
|
24
24
|
@expectings, @expectation_block = expectings, expectation_block
|
25
|
-
@expect_exception, @assertion_block =
|
25
|
+
@expect_exception, @assertion_block = self.class.assertions[#{name.inspect}]
|
26
26
|
self
|
27
27
|
end
|
28
28
|
EOC
|
@@ -39,7 +39,7 @@ module Riot
|
|
39
39
|
actual = situation.evaluate(&definition)
|
40
40
|
yield(expect_exception ? nil : actual)
|
41
41
|
rescue Exception => e
|
42
|
-
expect_exception ? yield(e) :
|
42
|
+
expect_exception ? yield(e) : self.class.error(e)
|
43
43
|
end
|
44
44
|
end # Assertion
|
45
45
|
end # Riot
|
data/riot.gemspec
CHANGED