From 32aeb3dd4e28fce0574593c0a4f8b38308e06730 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 Sep 2018 03:39:30 +0000 Subject: Refactor test [Fix GH-1946] From: Josh Cheek git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_ast.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'test') diff --git a/test/ruby/test_ast.rb b/test/ruby/test_ast.rb index 27c6753a7e..4761878a06 100644 --- a/test/ruby/test_ast.rb +++ b/test/ruby/test_ast.rb @@ -1,5 +1,6 @@ # frozen_string_literal: false require 'test/unit' +require 'tempfile' class RubyVM module AST @@ -161,16 +162,7 @@ class TestAst < Test::Unit::TestCase Tempfile.create(%w"test_ast .rb") do |f| f.puts "end" f.close - path = f.path - assert_in_out_err(%W[- #{path}], "#{<<-"begin;"}\n#{<<-"end;"}", /keyword_end/, [], success: true) - begin; - path = ARGV[0] - begin - RubyVM::AST.parse_file(path) - rescue SyntaxError => e - puts e.message - end - end; + assert_raise(SyntaxError) { RubyVM::AST.parse_file(f.path) } end end -- cgit v1.2.3