diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-08 02:54:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-08 02:54:21 +0000 |
commit | 4578181509ffaafb1e872d6f49f551cc887b727d (patch) | |
tree | fde5846b0d6ab8ca4863fb3478dd1e3189600859 /test/ruby/test_class.rb | |
parent | 81fb05db9a09759e50b9b8004a89fd281d36bf67 (diff) | |
download | ruby-4578181509ffaafb1e872d6f49f551cc887b727d.tar.gz |
Use assert_syntax_error
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r-- | test/ruby/test_class.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index b74833e894..93278a918f 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -242,23 +242,23 @@ class TestClass < Test::Unit::TestCase end def test_invalid_next_from_class_definition - assert_raise(SyntaxError) { eval("class C; next; end") } + assert_syntax_error("class C; next; end", /Invalid next/) end def test_invalid_break_from_class_definition - assert_raise(SyntaxError) { eval("class C; break; end") } + assert_syntax_error("class C; break; end", /Invalid break/) end def test_invalid_redo_from_class_definition - assert_raise(SyntaxError) { eval("class C; redo; end") } + assert_syntax_error("class C; redo; end", /Invalid redo/) end def test_invalid_retry_from_class_definition - assert_raise(SyntaxError) { eval("class C; retry; end") } + assert_syntax_error("class C; retry; end", /Invalid retry/) end def test_invalid_return_from_class_definition - assert_raise(SyntaxError) { eval("class C; return; end") } + assert_syntax_error("class C; return; end", /Invalid return/) end def test_invalid_yield_from_class_definition |