Permalink
Browse files

Use ruby provided by ruby's tests

When running tests in ruby's repository, ruby may not be installed.  The
tests now prefer the ruby built by the ruby repository over an installed
ruby.
  • Loading branch information...
1 parent 1e590aa commit 968682759b3b65e42748cd2befb2ff3e982272d9 @drbrain drbrain committed Dec 6, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/rake/file_utils.rb
  2. +4 −4 test/helper.rb
  3. +1 −1 test/test_rake_functional.rb
View
2 lib/rake/file_utils.rb
@@ -6,7 +6,7 @@
# added to the FileUtils utility functions.
module FileUtils
# Path to the currently running Ruby program
- RUBY = File.join(
+ RUBY = ENV['RUBY'] || File.join(
RbConfig::CONFIG['bindir'],
RbConfig::CONFIG['ruby_install_name'] + RbConfig::CONFIG['EXEEXT']).
sub(/.*\s.*/m, '"\&"')
View
8 test/helper.rb
@@ -12,8 +12,8 @@
require File.expand_path('../file_creation', __FILE__)
begin
- require 'test/ruby/envutil'
-rescue LoadError
+ require_relative '../ruby/envutil'
+rescue NoMethodError, LoadError
# for ruby trunk
end
@@ -515,8 +515,8 @@ def rakefile_test_signal
end
task :test do
- Rake::Task[:a].invoke rescue nil
- Rake::Task[:b].invoke rescue nil
+ Rake::Task[:a].invoke
+ Rake::Task[:b].invoke
end
task :default => :test
View
2 test/test_rake_functional.rb
@@ -480,7 +480,7 @@ def rake(*rake_options)
def run_ruby(option_list)
puts "COMMAND: [#{RUBY} #{option_list.join ' '}]" if @verbose
- inn, out, err, wait = Open3.popen3(Gem.ruby, *option_list)
+ inn, out, err, wait = Open3.popen3(RUBY, *option_list)
inn.close
@exit = wait ? wait.value : $?

0 comments on commit 9686827

Please sign in to comment.