Skip to content

Commit 8f7957e

Browse files
committed
[build] make test_xxx work standalone + avoid bundle exec
1 parent 7c6cbe2 commit 8f7957e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Rakefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ task :check_env do
176176
end
177177

178178
desc "Testing library (pure ruby)"
179-
task :test_pure => [ :check_env, :do_test_pure ]
179+
task :test_pure => [ :set_env_pure, :check_env, :do_test_pure ]
180+
task(:set_env_pure) { ENV['JSON'] = 'pure' }
180181

181182
UndocumentedTestTask.new do |t|
182183
t.name = 'do_test_pure'
@@ -187,10 +188,7 @@ UndocumentedTestTask.new do |t|
187188
end
188189

189190
desc "Testing library (pure ruby and extension)"
190-
task :test do
191-
sh "env JSON=pure #{BUNDLE} exec rake test_pure" or exit 1
192-
sh "env JSON=ext #{BUNDLE} exec rake test_ext" or exit 1
193-
end
191+
task :test => [ :test_pure, :test_ext ]
194192

195193
namespace :gems do
196194
desc 'Install all development gems'
@@ -257,7 +255,8 @@ if defined?(RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
257255
end
258256

259257
desc "Testing library (jruby)"
260-
task :test_ext => [ :check_env, :create_jar, :do_test_ext ]
258+
task :test_ext => [ :set_env_ext, :create_jar, :check_env, :do_test_ext ]
259+
task(:set_env_ext) { ENV['JSON'] = 'ext' }
261260

262261
UndocumentedTestTask.new do |t|
263262
t.name = 'do_test_ext'

0 commit comments

Comments
 (0)