summaryrefslogtreecommitdiff
path: root/test/-ext-
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-')
-rw-r--r--test/-ext-/marshal/test_usrmarshal.rb3
-rw-r--r--test/-ext-/typeddata/test_typeddata.rb15
2 files changed, 6 insertions, 12 deletions
diff --git a/test/-ext-/marshal/test_usrmarshal.rb b/test/-ext-/marshal/test_usrmarshal.rb
index 54adace7d6b..ae23223e15e 100644
--- a/test/-ext-/marshal/test_usrmarshal.rb
+++ b/test/-ext-/marshal/test_usrmarshal.rb
@@ -21,8 +21,7 @@ module Bug::Marshal
end
def test_incompat
- e = assert_raise(ArgumentError) {::Marshal.load(old_dump)}
- assert_equal("dump format error", e.message)
+ assert_raise_with_message(ArgumentError, "dump format error") {::Marshal.load(old_dump)}
end
def test_compat
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