diff --git a/test/lib/envutil.rb b/test/lib/envutil.rb index 152ea741c9..dac59bd984 100644 --- a/test/lib/envutil.rb +++ b/test/lib/envutil.rb @@ -282,10 +282,7 @@ if defined?(RbConfig) attr_reader :ruby end dir = File.dirname(ruby) - name = File.basename(ruby, CONFIG['EXEEXT']) CONFIG['bindir'] = dir - CONFIG['ruby_install_name'] = name - CONFIG['RUBY_INSTALL_NAME'] = name Gem::ConfigMap[:bindir] = dir if defined?(Gem::ConfigMap) end end diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 7f22df6479..caf00b2328 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -449,7 +449,8 @@ class TestRubyOptions < Test::Unit::TestCase def test_notfound notexist = "./notexist.rb" - rubybin = EnvUtil.rubybin.dup + dir, *rubybin = RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME', 'EXEEXT') + rubybin = "#{dir}/#{rubybin.join('')}" rubybin.gsub!(%r(/), '\\') if /mswin|mingw/ =~ RUBY_PLATFORM rubybin = Regexp.quote(rubybin) pat = Regexp.quote(notexist)