Skip to content

Commit 3b91db2

Browse files
committed
Make sure $! is set in at_exit spec
1 parent fa653f2 commit 3b91db2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spec/ruby/core/kernel/at_exit_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
it "gives access to the last raised exception" do
2424
code = <<-EOC
2525
at_exit do
26-
puts "The exception matches: \#{$! == $exception}"
26+
puts "The exception matches: \#{$! == $exception} (message=\#{$!.message})"
2727
end
2828
2929
begin
@@ -33,8 +33,8 @@
3333
end
3434
EOC
3535

36-
result = ruby_exe(code, args: "2>&1", escape: true)
37-
result.should =~ /The exception matches: true/
36+
result = ruby_exe(code, args: "2>&1")
37+
result.lines.should.include?("The exception matches: true (message=foo)\n")
3838
end
3939

4040
end

0 commit comments

Comments
 (0)