mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test_system.rb: exit by abort for portability
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2cbb6fa218
commit
0d829c4af4
1 changed files with 5 additions and 4 deletions
|
@ -165,14 +165,15 @@ class TestSystem < Test::Unit::TestCase
|
|||
ruby = EnvUtil.rubybin
|
||||
assert_nothing_raised do
|
||||
system('feature_14235', exception: false)
|
||||
system("'#{ruby}' -e 'exit 1'", exception: false)
|
||||
end
|
||||
assert_nothing_raised do
|
||||
system("'#{ruby}' -e abort", exception: false)
|
||||
end
|
||||
assert_raise(Errno::ENOENT) do
|
||||
system('feature_14235', exception: true)
|
||||
end
|
||||
e = assert_raise(RuntimeError) do
|
||||
system("'#{ruby}' -e 'exit 1'", exception: true)
|
||||
assert_raise_with_message(RuntimeError, /\ACommand failed with exit /) do
|
||||
system("'#{ruby}' -e abort", exception: true)
|
||||
end
|
||||
assert_match /\ACommand failed with exit 1:/, e.message
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue