aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_io_m17n.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_io_m17n.rb')
-rw-r--r--test/ruby/test_io_m17n.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb
index dee36abaaf..45fa98e897 100644
--- a/test/ruby/test_io_m17n.rb
+++ b/test/ruby/test_io_m17n.rb
@@ -763,10 +763,12 @@ EOT
assert_equal(eucjp, r.read)
end)
- e = assert_raise(ArgumentError) {with_pipe("UTF-8", "UTF-8".encode("UTF-32BE")) {}}
- assert_match(/invalid name encoding/, e.message)
- e = assert_raise(ArgumentError) {with_pipe("UTF-8".encode("UTF-32BE")) {}}
- assert_match(/invalid name encoding/, e.message)
+ assert_raise_with_message(ArgumentError, /invalid name encoding/) do
+ with_pipe("UTF-8", "UTF-8".encode("UTF-32BE")) {}
+ end
+ assert_raise_with_message(ArgumentError, /invalid name encoding/) do
+ with_pipe("UTF-8".encode("UTF-32BE")) {}
+ end
ENCS.each {|enc|
pipe(enc,