Skip to content

Commit

Permalink
Merge pull request #613 from ruby/update-test-layout
Browse files Browse the repository at this point in the history
Move test directory to test/json same as layout of other default gems
  • Loading branch information
hsbt authored Oct 16, 2024
2 parents 37332c5 + f8417ff commit bba5874
Show file tree
Hide file tree
Showing 49 changed files with 25 additions and 29 deletions.
11 changes: 3 additions & 8 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ task(:set_env_pure) { ENV['JSON'] = 'pure' }

UndocumentedTestTask.new do |t|
t.name = 'do_test_pure'
t.libs << 'lib' << 'tests' << 'tests/lib'
t.ruby_opts << "-rhelper"
t.test_files = FileList['tests/*_test.rb']
t.test_files = FileList['test/json/*_test.rb']
t.verbose = true
t.options = '-v'
end
Expand Down Expand Up @@ -187,8 +185,7 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'

UndocumentedTestTask.new do |t|
t.name = 'do_test_ext'
t.libs << 'lib' << 'tests'
t.test_files = FileList['tests/*_test.rb']
t.test_files = FileList['test/json/*_test.rb']
t.verbose = true
t.options = '-v'
end
Expand Down Expand Up @@ -266,9 +263,7 @@ else

UndocumentedTestTask.new do |t|
t.name = 'do_test_ext'
t.libs << 'lib' << 'tests' << "tests/lib"
t.ruby_opts << '-rhelper'
t.test_files = FileList['tests/*_test.rb']
t.test_files = FileList['test/json/*_test.rb']
t.verbose = true
t.options = '-v'
end
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 22 additions & 0 deletions test/json/test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
case ENV['JSON']
when 'pure'
$:.unshift File.join(__dir__, '../../lib')
require 'json/pure'
when 'ext'
$:.unshift File.join(__dir__, '../../ext'), File.join(__dir__, '../../lib')
require 'json/ext'
else
$:.unshift File.join(__dir__, '../../ext'), File.join(__dir__, '../../lib')
require 'json'
end

require 'test/unit'
begin
require 'byebug'
rescue LoadError
end

unless defined?(Test::Unit::CoreAssertions)
require "core_assertions"
Test::Unit::TestCase.include Test::Unit::CoreAssertions
end
4 changes: 0 additions & 4 deletions tests/lib/helper.rb

This file was deleted.

17 changes: 0 additions & 17 deletions tests/test_helper.rb

This file was deleted.

0 comments on commit bba5874

Please sign in to comment.