summaryrefslogtreecommitdiff
path: root/test/racc
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-02 14:11:24 +0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-06-19 18:17:53 +0900
commit4cca8c4d2021c90e351d0ee9000d448a9ed85e83 (patch)
tree5ec10c3a5788a6f1cac20e288d3adb807cfb5322 /test/racc
parent2272d6ae24d4a059d57bd1b0c01587a934258084 (diff)
downloadruby-4cca8c4d2021c90e351d0ee9000d448a9ed85e83.tar.gz
Use Test::Unit instead of Minitest and fixed test error with ruby repo.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Diffstat (limited to 'test/racc')
-rw-r--r--test/racc/helper.rb22
-rw-r--r--test/racc/test_racc_command.rb4
2 files changed, 9 insertions, 17 deletions
diff --git a/test/racc/helper.rb b/test/racc/helper.rb
index 4695b61eaf..2c9c3fce63 100644
--- a/test/racc/helper.rb
+++ b/test/racc/helper.rb
@@ -6,7 +6,7 @@ require 'tempfile'
require 'timeout'
module Racc
- class TestCase < MiniTest::Unit::TestCase
+ class TestCase < Test::Unit::TestCase
PROJECT_DIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
test_dir = File.join(PROJECT_DIR, 'test')
@@ -48,7 +48,7 @@ module Racc
"-O#{OUT_DIR}/#{file}",
"-o#{TAB_DIR}/#{file}",
]
- racc "#{args.join(' ')}"
+ racc *args
end
def assert_debugfile(asset, ok)
@@ -71,9 +71,7 @@ module Racc
def assert_exec(asset)
file = File.basename(asset, '.y')
- Dir.chdir(TEST_DIR) do
- ruby("#{TAB_DIR}/#{file}")
- end
+ ruby("#{TAB_DIR}/#{file}")
end
def strip_version(source)
@@ -91,18 +89,12 @@ module Racc
"expectation. Try compiling it and diff with test/regress/#{file}.")
end
- def racc(arg)
- ruby "-S #{RACC} #{arg}"
+ def racc(*arg)
+ ruby "-S", RACC, *arg
end
- def ruby(arg)
- Dir.chdir(TEST_DIR) do
- Tempfile.open 'test' do |io|
- cmd = "#{ENV['_'] || Gem.ruby} -I #{INC} #{arg} 2>#{io.path}"
- result = system(cmd)
- assert(result, io.read)
- end
- end
+ def ruby(*arg)
+ assert_ruby_status(["-C", TEST_DIR, *arg])
end
end
end
diff --git a/test/racc/test_racc_command.rb b/test/racc/test_racc_command.rb
index 1fc5413399..2409bb3c31 100644
--- a/test/racc/test_racc_command.rb
+++ b/test/racc/test_racc_command.rb
@@ -141,13 +141,13 @@ module Racc
end
def test_norule_y
- assert_raises(MiniTest::Assertion) {
+ assert_raise(MiniTest::Assertion) {
assert_compile 'norule.y'
}
end
def test_unterm_y
- assert_raises(MiniTest::Assertion) {
+ assert_raise(MiniTest::Assertion) {
assert_compile 'unterm.y'
}
end