From e9ff9e79e4f32a71be8ad8d630b67de300ac2b36 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Mar 2015 08:17:51 +0000 Subject: test_process.rb: use assert_in_out_err * test/ruby/test_process.rb (test_status_quit): use assert_in_out_err to simplify and clean diagnostic reports. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_process.rb | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index a43a5fa1a9..b47c1e46a9 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1248,26 +1248,12 @@ class TestProcess < Test::Unit::TestCase return unless Signal.list.include?("QUIT") with_tmpchdir do - write_file("foo", "puts;STDOUT.flush;sleep 30") - pid = nil - IO.pipe do |r, w| - pid = spawn(RUBY, "foo", out: w) - w.close - th = Thread.new { r.read(1); Process.kill(:SIGQUIT, pid) } - Process.wait(pid) - th.join - end - t = Time.now - s = $? + s = assert_in_out_err([], "Process.kill(:SIGQUIT, $$);sleep 30", //, //) assert_equal([false, true, false, nil], [s.exited?, s.signaled?, s.stopped?, s.success?], "[s.exited?, s.signaled?, s.stopped?, s.success?]") - assert_send( - [["#", - "#"], - :include?, - s.inspect]) - EnvUtil.diagnostic_reports("QUIT", RUBY, pid, t) + assert_equal("#", + s.inspect.sub(/ \(core dumped\)(?=>\z)/, '')) end end -- cgit v1.2.3