mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Resolve @@project_dir
from test file paths
`Dir.pwd` may differ from the source path. Test directories and files should be resolved from test file paths. https://github.com/rubygems/rubygems/commit/e18e7c81b4
This commit is contained in:
parent
3a227b99e7
commit
99680f81e8
3 changed files with 4 additions and 2 deletions
|
@ -232,8 +232,6 @@ class Gem::TestCase < (defined?(Minitest::Test) ? Minitest::Test : MiniTest::Uni
|
|||
undef_method :default_test if instance_methods.include? 'default_test' or
|
||||
instance_methods.include? :default_test
|
||||
|
||||
@@project_dir = Dir.pwd.untaint unless defined?(@@project_dir)
|
||||
|
||||
##
|
||||
# #setup prepares a sandboxed location to install gems. All installs are
|
||||
# directed to a temporary directory. All install plugins are removed.
|
||||
|
|
|
@ -17,6 +17,8 @@ class TestGem < Gem::TestCase
|
|||
|
||||
PLUGINS_LOADED = [] # rubocop:disable Style/MutableConstant
|
||||
|
||||
@@project_dir = File.expand_path('../../..', __FILE__).untaint
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ require 'rubygems/command_manager'
|
|||
|
||||
class TestGemCommandManager < Gem::TestCase
|
||||
|
||||
@@project_dir = File.expand_path('../../..', __FILE__).untaint
|
||||
|
||||
def setup
|
||||
super
|
||||
|
||||
|
|
Loading…
Reference in a new issue