aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-03 08:17:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-03 08:17:51 +0000
commite9ff9e79e4f32a71be8ad8d630b67de300ac2b36 (patch)
tree478328782cbf9c7ddc054cb0a00007ec4ef5828d /test
parent41eb94d4b4e6eff1fe90916a34db48ff42f17234 (diff)
downloadruby-e9ff9e79e4f32a71be8ad8d630b67de300ac2b36.tar.gz
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_process.rb20
1 files 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(
- [["#<Process::Status: pid #{ s.pid } SIGQUIT (signal #{ s.termsig })>",
- "#<Process::Status: pid #{ s.pid } SIGQUIT (signal #{ s.termsig }) (core dumped)>"],
- :include?,
- s.inspect])
- EnvUtil.diagnostic_reports("QUIT", RUBY, pid, t)
+ assert_equal("#<Process::Status: pid #{ s.pid } SIGQUIT (signal #{ s.termsig })>",
+ s.inspect.sub(/ \(core dumped\)(?=>\z)/, ''))
end
end