1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_rubyoptions.rb: ruby-runner sets $0 to install name now

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-05-30 11:59:26 +00:00
parent cf02692f3e
commit 76be4743ba
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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)