tengu 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tengu/it_block.rb +12 -2
- data/lib/tengu/version.rb +1 -1
- data/spec/fixtures/example.rb +4 -0
- data/spec/it_block_spec.rb +4 -0
- 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: 3f7eb80850505454fb37a9be7be811e886d0a2cf
|
4
|
+
data.tar.gz: ceeb40d2fbbc61a7add948df5a6c2cb31dc13b2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c21847fc91f685900bea59f754c904ce62bce87f070d468796cf7f253260d39ab1bf27cc90a67eabb3a158d76d90bc12e51bea861e24db9491ca6c46a40b3b47
|
7
|
+
data.tar.gz: e24abcc8441dbb021578a74ff002e042aea88332ca80efc3296e31eb0bbfe0268a55d146296c9db1a3a0ba30f056bf8305035895e982f40dc9a9696fa9114cb2
|
data/lib/tengu/it_block.rb
CHANGED
@@ -15,16 +15,26 @@ module Tengu
|
|
15
15
|
@success = true
|
16
16
|
@pending = false
|
17
17
|
@expectations = []
|
18
|
+
@error = nil
|
18
19
|
end
|
19
20
|
|
20
21
|
def run(listeners = [])
|
21
22
|
@listeners = listeners
|
22
|
-
|
23
|
+
begin
|
24
|
+
instance_eval(&@block)
|
25
|
+
rescue Exception => e
|
26
|
+
@error = e
|
27
|
+
@success = false
|
28
|
+
end
|
23
29
|
notify(@listeners)
|
24
30
|
end
|
25
31
|
|
32
|
+
def errored?
|
33
|
+
@error
|
34
|
+
end
|
35
|
+
|
26
36
|
def success?
|
27
|
-
unless pending?
|
37
|
+
unless pending? || errored?
|
28
38
|
@expectations.all? { |expectation| expectation.success? }
|
29
39
|
end
|
30
40
|
end
|
data/lib/tengu/version.rb
CHANGED
data/spec/fixtures/example.rb
CHANGED
data/spec/it_block_spec.rb
CHANGED