Skip to content

Commit

Permalink
Merge pull request #168 from ruby/split-test-helper
Browse files Browse the repository at this point in the history
Split helper file to test-case and runner helper
  • Loading branch information
hsbt committed Sep 14, 2021
2 parents 46af6e9 + 1f8b05b commit 69be19c
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
4 changes: 3 additions & 1 deletion Rakefile
Expand Up @@ -19,9 +19,11 @@ end
require 'rake/testtask'

Rake::TestTask.new(:test) do |t|
t.libs << "test/lib"
t.ruby_opts << "-rhelper"
t.test_files = FileList["test/**/test_*.rb"]
if RUBY_VERSION >= "2.6"
t.ruby_opts = %w[--enable-frozen-string-literal --debug=frozen-string-literal]
t.ruby_opts << %w[--enable-frozen-string-literal --debug=frozen-string-literal]
end
end
gem 'rake-compiler', '>= 0.4.1'
Expand Down
2 changes: 1 addition & 1 deletion test/assets/mof.y
Expand Up @@ -565,7 +565,7 @@ require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'helper')
require File.join(File.dirname(__FILE__), 'case')
---- inner ----
Expand Down
5 changes: 0 additions & 5 deletions test/helper.rb → test/case.rb
Expand Up @@ -3,11 +3,6 @@
begin

require 'test/unit'
begin
require_relative './lib/core_assertions'
Test::Unit::TestCase.include Test::Unit::CoreAssertions
rescue LoadError
end
require 'racc/static'
require 'fileutils'
require 'tempfile'
Expand Down
4 changes: 4 additions & 0 deletions test/lib/helper.rb
@@ -0,0 +1,4 @@
require_relative '../case'
require_relative 'core_assertions'

Racc::TestCase.include Test::Unit::CoreAssertions
2 changes: 1 addition & 1 deletion test/regress/mof
Expand Up @@ -14,7 +14,7 @@ require 'rubygems'
require 'cim'
require File.join(File.dirname(__FILE__), 'result')
require File.join(File.dirname(__FILE__), 'scanner')
require File.join(File.dirname(__FILE__), 'helper')
require File.join(File.dirname(__FILE__), 'case')

module MOF
class Parser < Racc::Parser
Expand Down
2 changes: 1 addition & 1 deletion test/test_chk_y.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestChkY < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_grammar_file_parser.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestGrammarFileParser < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_racc_command.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestRaccCommand < TestCase
Expand Down
2 changes: 1 addition & 1 deletion test/test_scan_y.rb
@@ -1,4 +1,4 @@
require File.expand_path(File.join(File.dirname(__FILE__), 'helper'))
require File.expand_path(File.join(File.dirname(__FILE__), 'case'))

module Racc
class TestScanY < TestCase
Expand Down

0 comments on commit 69be19c

Please sign in to comment.