Skip to content

Commit

Permalink
handle exit status change in Ruby 2.0 (more) gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
jhellerstein committed Nov 18, 2016
1 parent fcba181 commit d041f99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/tc_execmodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ def kill_child_with_signal(parent_class, signal)
_, status = Process.waitpid2(pid)
assert(!status.signaled?) # Should have caught the signal
assert(status.exited?)
assert_equal(0, status.exitstatus)
rubyMajorVersion = RUBY_VERSION.split('.')[0].to_i
if (rubyMajorVersion < 2)
assert_equal(0, status.exitstatus)
else
assert_equal(1, status.exitstatus)
end
parent.stop
read.close ; write.close
end
Expand Down

0 comments on commit d041f99

Please sign in to comment.