This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 8
8
let ( :failure_exit_code ) { rand ( 97 ) + 2 } # 2..99
9
9
let ( :error_exit_code ) { failure_exit_code + 2 } # 4..101
10
10
11
- if RSpec ::Support ::Ruby . jruby_9000?
11
+ if RSpec ::Support ::Ruby . jruby_9000? && RSpec ::Support ::Ruby . jruby_version > '9.2.0.0'
12
+ let ( :spec_line_suffix ) { ":in `block in <main>'" }
13
+ elsif RSpec ::Support ::Ruby . jruby_9000?
12
14
let ( :spec_line_suffix ) { ":in `block in (root)'" }
13
15
elsif RSpec ::Support ::Ruby . jruby?
14
16
let ( :spec_line_suffix ) { ":in `(root)'" }
@@ -97,6 +99,19 @@ def run_spec_expecting_non_zero(before_or_after)
97
99
end
98
100
"
99
101
102
+ cause =
103
+ if RSpec ::Support ::Ruby . jruby_9000? && RSpec ::Support ::Ruby . jruby_version > '9.2.0.0'
104
+ unindent ( <<-EOS )
105
+ # ------------------
106
+ # --- Caused by: ---
107
+ # RuntimeError:
108
+ # before 1
109
+ # ./the_spec.rb:3:in `block in <main>'
110
+ EOS
111
+ else
112
+ ""
113
+ end
114
+
100
115
run_command "the_spec.rb"
101
116
expect ( last_cmd_exit_status ) . to eq ( error_exit_code )
102
117
output = normalize_durations ( last_cmd_stdout )
@@ -116,14 +131,14 @@ def run_spec_expecting_non_zero(before_or_after)
116
131
RuntimeError:
117
132
after 2
118
133
# ./the_spec.rb:6#{ spec_line_suffix }
119
-
134
+ #{ cause }
120
135
An error occurred in an `after(:suite)` hook.
121
136
Failure/Error: c.after(:suite) { raise 'after 1' }
122
137
123
138
RuntimeError:
124
139
after 1
125
140
# ./the_spec.rb:5#{ spec_line_suffix }
126
-
141
+ #{ cause }
127
142
128
143
Finished in n.nnnn seconds (files took n.nnnn seconds to load)
129
144
0 examples, 0 failures, 3 errors occurred outside of examples
You can’t perform that action at this time.
0 commit comments