diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index ba25f8a489..83bc907f8b 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -545,14 +545,19 @@ class TestRubyOptions < Test::Unit::TestCase opts = SEGVTest::ExecOptions.dup bug7402 = '[ruby-core:49573]' - status = assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', - '-e', '$".clear', - '-e', '$".unshift Bogus.new', - '-e', '(p $"; abort) unless $".size == 1', - '-e', 'Process.kill :SEGV, $$'], - "", [], /#<Bogus:/, - nil, - opts) + + status = Dir.mktmpdir("segv_test") do |tmpdir| + assert_in_out_err(['-e', 'class Bogus; def to_str; exit true; end; end', + '-e', '$".clear', + '-e', '$".unshift Bogus.new', + '-e', '(p $"; abort) unless $".size == 1', + '-e', 'Process.kill :SEGV, $$', + '-C', tmpdir, + ], + "", [], /#<Bogus:/, + nil, + opts) + end assert_not_predicate(status, :success?, "segv but success #{bug7402}") end |