aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_beginendblock.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_beginendblock.rb')
-rw-r--r--test/ruby/test_beginendblock.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb
index 7a9eb23bfa..e7901bce5e 100644
--- a/test/ruby/test_beginendblock.rb
+++ b/test/ruby/test_beginendblock.rb
@@ -85,8 +85,22 @@ EOW
'-e', 'raise %[SomethingElse]']) {|f|
f.read
}
+ status = $?
assert_match(/SomethingBad/, out, "[ruby-core:9675]")
assert_match(/SomethingElse/, out, "[ruby-core:9675]")
+ assert_not_predicate(status, :success?)
+ end
+
+ def test_exitcode_in_at_exit
+ bug8501 = '[ruby-core:55365] [Bug #8501]'
+ out = IO.popen([ruby, '-e', 'STDERR.reopen(STDOUT)',
+ '-e', 'o = Object.new; def o.inspect; raise "[Bug #8501]"; end',
+ '-e', 'at_exit{o.nope}']) {|f|
+ f.read
+ }
+ status = $?
+ assert_match(/undefined method `nope'/, out, bug8501)
+ assert_not_predicate(status, :success?, bug8501)
end
def test_propagate_exit_code