Skip to content

Commit cdbc6db

Browse files
committed
Fix rake release:test
1 parent 479a557 commit cdbc6db

File tree

1 file changed

+17
-22
lines changed

1 file changed

+17
-22
lines changed

Rakefile

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ begin
8383

8484
desc '* test packaged and installed gems instead of local files'
8585
task :installed do
86-
Dir.chdir(__dir__) do
87-
sh "gem install pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
88-
sh "gem install pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem" if Concurrent.on_cruby?
89-
sh "gem install pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
90-
ENV['NO_PATH'] = 'true'
91-
sh 'bundle update'
92-
sh 'bundle exec rake spec:ci'
86+
Bundler.with_original_env do
87+
Dir.chdir(__dir__) do
88+
sh "gem install pkg/concurrent-ruby-#{Concurrent::VERSION}.gem"
89+
sh "gem install pkg/concurrent-ruby-ext-#{Concurrent::VERSION}.gem" if Concurrent.on_cruby?
90+
sh "gem install pkg/concurrent-ruby-edge-#{Concurrent::EDGE_VERSION}.gem"
91+
ENV['NO_PATH'] = 'true'
92+
sh 'bundle update'
93+
sh 'bundle exec rake spec:ci'
94+
end
9395
end
9496
end
9597
end
@@ -250,25 +252,18 @@ namespace :release do
250252
desc '* test actual installed gems instead of cloned repository on MRI and JRuby'
251253
task :test do
252254
Dir.chdir(__dir__) do
253-
old = ENV['RBENV_VERSION']
254-
255-
mri_version = `ruby -e 'puts RUBY_VERSION'`.chomp
256-
jruby_version = File.basename(ENV['CONCURRENT_JRUBY_HOME'])
255+
puts "Testing with the installed gem"
257256

258-
puts "Using following version:"
259-
pp mri_version: mri_version, jruby_version: jruby_version
260-
261-
ENV['RBENV_VERSION'] = mri_version
262-
sh 'rbenv version'
263-
sh 'bundle exec rake spec:installed'
257+
Bundler.with_original_env do
258+
sh 'ruby -v'
259+
sh 'bundle exec rake spec:installed'
264260

265-
ENV['RBENV_VERSION'] = jruby_version
266-
sh 'rbenv version'
267-
sh 'bundle exec rake spec:installed'
261+
env = { "PATH" => "#{ENV['CONCURRENT_JRUBY_HOME']}/bin:#{ENV['PATH']}" }
262+
sh env, 'ruby -v'
263+
sh env, 'bundle exec rake spec:installed'
264+
end
268265

269266
puts 'Windows build is untested'
270-
271-
ENV['RBENV_VERSION'] = old
272267
end
273268
end
274269

0 commit comments

Comments
 (0)