mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/ruby/envutil.rb (EnvUtil#rubybin): fake also rbconfig.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a6b81a6b6e
commit
8f3f9d715f
2 changed files with 20 additions and 4 deletions
|
@ -20,10 +20,9 @@ module EnvUtil
|
|||
end
|
||||
ruby = File.join("..", ruby)
|
||||
end
|
||||
begin
|
||||
require "rbconfig"
|
||||
if defined?(RbConfig.ruby)
|
||||
RbConfig.ruby
|
||||
rescue LoadError
|
||||
else
|
||||
"ruby"
|
||||
end
|
||||
end
|
||||
|
@ -202,3 +201,20 @@ module Test
|
|||
end
|
||||
end
|
||||
|
||||
begin
|
||||
require 'rbconfig'
|
||||
rescue LoadError
|
||||
else
|
||||
module RbConfig
|
||||
@ruby = EnvUtil.rubybin
|
||||
class << self
|
||||
undef ruby if defined?(ruby)
|
||||
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
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require "test/unit"
|
||||
require File.join(File.dirname(__FILE__), "utils.rb")
|
||||
require "webrick"
|
||||
require "stringio"
|
||||
require File.join(File.dirname(__FILE__), "utils.rb")
|
||||
|
||||
class WEBrick::TestFileHandler < Test::Unit::TestCase
|
||||
def default_file_handler(filename)
|
||||
|
|
Loading…
Reference in a new issue