summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 03:39:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-07 03:39:30 +0000
commit32aeb3dd4e28fce0574593c0a4f8b38308e06730 (patch)
treea93dc6b348398845e2977e23e38d9d58fc5e3eac /test
parent8eb96c613718beea355e8cc2f2c7e3672f13eb8e (diff)
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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_ast.rb12
1 files changed, 2 insertions, 10 deletions
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