summaryrefslogtreecommitdiff
path: root/test/-ext-/typeddata/test_typeddata.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/-ext-/typeddata/test_typeddata.rb
parent289d6bb30f4c2fffa2437436030c889f10522e72 (diff)
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/-ext-/typeddata/test_typeddata.rb')
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/test/-ext-/typeddata/test_typeddata.rb b/test/-ext-/typeddata/test_typeddata.rb
index 50505850d83..c24ad08004b 100644
--- a/test/-ext-/typeddata/test_typeddata.rb
+++ b/test/-ext-/typeddata/test_typeddata.rb
@@ -3,19 +3,14 @@ require "-test-/typeddata/typeddata"
class Test_TypedData < Test::Unit::TestCase
def test_wrong_argtype
- e = assert_raise(TypeError) {Bug::TypedData.check(false)}
- assert_equal("wrong argument type false (expected typed_data)", e.message)
+ assert_raise_with_message(TypeError, "wrong argument type false (expected typed_data)") {Bug::TypedData.check(false)}
- e = assert_raise(TypeError) {Bug::TypedData.check(true)}
- assert_equal("wrong argument type true (expected typed_data)", e.message)
+ assert_raise_with_message(TypeError, "wrong argument type true (expected typed_data)") {Bug::TypedData.check(true)}
- e = assert_raise(TypeError) {Bug::TypedData.check(:e)}
- assert_equal("wrong argument type Symbol (expected typed_data)", e.message)
+ assert_raise_with_message(TypeError, "wrong argument type Symbol (expected typed_data)") {Bug::TypedData.check(:e)}
- e = assert_raise(TypeError) {Bug::TypedData.check(0)}
- assert_equal("wrong argument type Fixnum (expected typed_data)", e.message)
+ assert_raise_with_message(TypeError, "wrong argument type Fixnum (expected typed_data)") {Bug::TypedData.check(0)}
- e = assert_raise(TypeError) {Bug::TypedData.check("a")}
- assert_equal("wrong argument type String (expected typed_data)", e.message)
+ assert_raise_with_message(TypeError, "wrong argument type String (expected typed_data)") {Bug::TypedData.check("a")}
end
end