Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 97553ef

Browse files
committed
Generalize exit spec to depend less implementation-specific details
1 parent 20c04d0 commit 97553ef

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

spec/integration/spec_file_load_errors_spec.rb

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,15 @@
8989
run_command "--require ./helper_with_exit.rb"
9090
}.to raise_error(SystemExit)
9191
output = normalize_durations(last_cmd_stdout)
92+
# Remove extra line which is only shown on CRuby
93+
output = output.sub("# ./helper_with_exit.rb:1:in `exit'\n", "")
94+
9295
if defined?(JRUBY_VERSION) && !JRUBY_VERSION.empty?
9396
expect(output).to eq unindent(<<-EOS)
9497
9598
While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit.
9699
Failure/Error: Unable to find org/jruby/RubyKernel.java to read failed line
97100
98-
SystemExit:
99-
exit
100-
# ./helper_with_exit.rb:1#{spec_line_suffix}
101-
EOS
102-
elsif RSpec::Support::Ruby.truffleruby?
103-
# No extra ./helper_with_exit.rb:1:in `exit' line on truffleruby, Kernel#exit is defined in Ruby code
104-
expect(output).to eq unindent(<<-EOS)
105-
106-
While loading ./helper_with_exit.rb an `exit` / `raise SystemExit` occurred, RSpec will now quit.
107-
Failure/Error: exit 999
108-
109101
SystemExit:
110102
exit
111103
# ./helper_with_exit.rb:1#{spec_line_suffix}
@@ -118,7 +110,6 @@
118110
119111
SystemExit:
120112
exit
121-
# ./helper_with_exit.rb:1:in `exit'
122113
# ./helper_with_exit.rb:1#{spec_line_suffix}
123114
EOS
124115
end

0 commit comments

Comments
 (0)