ruby-changes:52445
From: nobu <ko1@a...>
Date: Fri, 7 Sep 2018 12:42:55 +0900 (JST)
Subject: [ruby-changes:52445] nobu:r64654 (trunk): test/ruby/test_ast.rb: assert error messages too
nobu 2018-09-07 12:42:51 +0900 (Fri, 07 Sep 2018) New Revision: 64654 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64654 Log: test/ruby/test_ast.rb: assert error messages too Modified files: trunk/test/ruby/test_ast.rb Index: test/ruby/test_ast.rb =================================================================== --- test/ruby/test_ast.rb (revision 64653) +++ test/ruby/test_ast.rb (revision 64654) @@ -155,14 +155,18 @@ class TestAst < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_ast.rb#L155 end def test_parse_raises_syntax_error - assert_raise(SyntaxError) { RubyVM::AST.parse("end") } + assert_raise_with_message(SyntaxError, /keyword_end/) do + RubyVM::AST.parse("end") + end end def test_parse_file_raises_syntax_error Tempfile.create(%w"test_ast .rb") do |f| f.puts "end" f.close - assert_raise(SyntaxError) { RubyVM::AST.parse_file(f.path) } + assert_raise_with_message(SyntaxError, /keyword_end/) do + RubyVM::AST.parse_file(f.path) + end end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/