1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Refactor test

[Fix GH-1946]

From: Josh Cheek <josh.cheek@gmail.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-09-07 03:39:30 +00:00
parent 8eb96c6137
commit 32aeb3dd4e

View file

@ -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