matest 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/matest/spec_printer.rb +6 -4
- data/lib/matest/version.rb +1 -1
- data/spec/matest_specs/explanation_spec.rb +9 -2
- 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: ce89b8aefb2465f4ce1ba05ccf1631753f1eb652
|
4
|
+
data.tar.gz: ac6b4b4dcc5b6f2da444e9f38924cc6b2cb6c65e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 580dbcc929e9d39d1a8aa04cc63cdfd827fc6ec624385bdda9a3db5e0035a16c674341e8ba244b42355989527f888a60d8b1e4a5ab80e019844748d1913fb9e1
|
7
|
+
data.tar.gz: 572fc3a4fede3ae6d501df17cc37e3b5e5d50ce24860ecce6465e87cabca892423cb923f22dd49404c723777e582ad383a701911e06a8b90d07276b38fbd554d
|
data/lib/matest/spec_printer.rb
CHANGED
@@ -82,10 +82,12 @@ module Matest
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def print_subexpression(subexpression, status)
|
85
|
-
just_before_assertion = status.example.just_before_assertion
|
86
|
-
code = just_before_assertion + subexpression
|
87
|
-
|
88
|
-
result = Evaluator.new(just_before_assertion,
|
85
|
+
just_before_assertion = status.example.just_before_assertion
|
86
|
+
code = just_before_assertion.code + subexpression
|
87
|
+
|
88
|
+
result = Evaluator.new(just_before_assertion, just_before_assertion.before_assertion_block).eval_string(code)
|
89
|
+
|
90
|
+
#result = Evaluator.new(just_before_assertion, proc{}).eval_string(code)
|
89
91
|
if result.class != Matest::EvalErr
|
90
92
|
explanation = []
|
91
93
|
explanation << expression(" #{subexpression}")
|
data/lib/matest/version.rb
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
scope do
|
4
|
-
|
4
|
+
xspec "it explains local variables on failure" do
|
5
5
|
a = 5
|
6
6
|
b = 6
|
7
7
|
|
8
8
|
a + b == 10
|
9
9
|
end
|
10
10
|
|
11
|
-
|
11
|
+
xspec "it explains local variables on non natural" do
|
12
12
|
a = 5
|
13
13
|
b = 6
|
14
14
|
|
15
15
|
a + rand(b)
|
16
16
|
end
|
17
|
+
|
18
|
+
let(:b) { 1 }
|
19
|
+
xspec "still works with lets" do
|
20
|
+
a = 1
|
21
|
+
|
22
|
+
a + b == 3
|
23
|
+
end
|
17
24
|
end
|