summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_ast.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb
index 4761878a06..d053ce5a49 100644
--- a/test/ruby/test_ast.rb
+++ b/test/ruby/test_ast.rb
@@ -155,14 +155,18 @@ class TestAst < Test::Unit::TestCase
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