diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-27 09:08:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-03-27 09:08:51 +0000 |
commit | 2dc8f669a8874d89e719b7d96b7249fa92c27c11 (patch) | |
tree | 67ff86947f2a231f42a76eaeb4b29103cc512182 /test/ruby | |
parent | 7c9f1aa3d5172340b6b2a0aafdad5528b523a287 (diff) |
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
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_m17n_comb.rb | 11 |
1 files 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 |