summaryrefslogtreecommitdiff
path: root/test/ruby/test_signal.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 08:43:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-09 08:43:12 +0000
commit9ef55da91006a19dc4fb612c735b335175b3259b (patch)
treed1b5676b11b6cf64709f040c2c1b4aba60da02fe /test/ruby/test_signal.rb
parent289d6bb30f4c2fffa2437436030c889f10522e72 (diff)
downloadruby-9ef55da91006a19dc4fb612c735b335175b3259b.tar.gz
test/unit/assertions.rb: return exception
* lib/test/unit/assertions.rb (assert_raise_with_message): return raised exception same as assert_raise. * test/ruby, test/-ext-: use assert_raise_with_message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_signal.rb')
-rw-r--r--test/ruby/test_signal.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index ba0ee6d9e4..c7bcc4a375 100644
--- a/test/ruby/test_signal.rb
+++ b/test/ruby/test_signal.rb
@@ -16,12 +16,10 @@ class TestSignal < Test::Unit::TestCase
assert_equal 2, x
Signal.trap(:INT) { raise "Interrupt" }
- ex = assert_raise(RuntimeError) {
+ assert_raise_with_message(RuntimeError, /Interrupt/) {
Process.kill :INT, Process.pid
sleep 0.1
}
- assert_kind_of Exception, ex
- assert_match(/Interrupt/, ex.message)
ensure
Signal.trap :INT, oldtrap if oldtrap
end