File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ def register(object, thread)
30
30
@records << OpenStruct . new (
31
31
thread : thread ,
32
32
object : object ,
33
- example : $current_example,
33
+ # When rake spec:prepare is run, the current_example method is not defined
34
+ example : RSpec . respond_to? ( :current_example ) ? RSpec . current_example : nil ,
34
35
)
35
36
end
36
37
end
@@ -46,7 +47,7 @@ def verify_empty!
46
47
msg << "\n with options: #{ record . object . options } "
47
48
end
48
49
if record . example
49
- msg << "\n in #{ record . example . id } #{ record . example . full_description } "
50
+ msg << "\n in #{ record . example . id } : #{ record . example . full_description } "
50
51
else
51
52
msg << "\n not in an example"
52
53
end
@@ -57,14 +58,3 @@ def verify_empty!
57
58
end
58
59
end
59
60
end
60
-
61
- RSpec . configure do |config |
62
- config . around do |example |
63
- $current_example = example
64
- begin
65
- example . run
66
- ensure
67
- $current_example = nil
68
- end
69
- end
70
- end
You can’t perform that action at this time.
0 commit comments