ruby-changes:54816
From: nobu <ko1@a...>
Date: Fri, 8 Feb 2019 11:54:25 +0900 (JST)
Subject: [ruby-changes:54816] nobu:r67035 (trunk): Use assert_syntax_error
nobu 2019-02-08 11:54:21 +0900 (Fri, 08 Feb 2019) New Revision: 67035 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67035 Log: Use assert_syntax_error Modified files: trunk/test/ruby/test_class.rb Index: test/ruby/test_class.rb =================================================================== --- test/ruby/test_class.rb (revision 67034) +++ test/ruby/test_class.rb (revision 67035) @@ -242,23 +242,23 @@ class TestClass < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_class.rb#L242 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/