From 2dc8f669a8874d89e719b7d96b7249fa92c27c11 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 27 Mar 2014 09:08:51 +0000 Subject: [PATCH] test_m17n_comb.rb: refine assertions * test/ruby/test_m17n_comb.rb (test_str_scan): refine assertion messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_m17n_comb.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/ruby/test_m17n_comb.rb b/test/ruby/test_m17n_comb.rb index 446ceccc4a..ee43c746f8 100644 --- a/test/ruby/test_m17n_comb.rb +++ b/test/ruby/test_m17n_comb.rb @@ -1036,25 +1036,26 @@ class TestM17NComb < Test::Unit::TestCase def test_str_scan combination(STRINGS, STRINGS) {|s1, s2| + desc = proc {"#{s1.dump}.scan(#{s2.dump})"} if !s2.valid_encoding? - assert_raise(RegexpError) { s1.scan(s2) } + assert_raise(RegexpError, desc) { s1.scan(s2) } next end if !s1.ascii_only? && !s2.ascii_only? && s1.encoding != s2.encoding if s1.valid_encoding? - assert_raise(Encoding::CompatibilityError) { s1.scan(s2) } + assert_raise(Encoding::CompatibilityError, desc) { s1.scan(s2) } else - assert_match(/invalid byte sequence/, assert_raise(ArgumentError) { s1.scan(s2) }.message) + assert_raise_with_message(ArgumentError, /invalid byte sequence/, desc) { s1.scan(s2) } end next end if !s1.valid_encoding? - assert_raise(ArgumentError) { s1.scan(s2) } + assert_raise(ArgumentError, desc) { s1.scan(s2) } next end r = enccall(s1, :scan, s2) r.each {|t| - assert_equal(s2, t) + assert_equal(s2, t, desc) } } end