1
0
Fork 0
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:
Nobuyoshi Nakada 2019-07-24 13:24:18 +09:00 committed by Hiroshi SHIBATA
parent 3a227b99e7
commit 99680f81e8
3 changed files with 4 additions and 2 deletions

View file

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

View file

@ -17,6 +17,8 @@ class TestGem < Gem::TestCase
PLUGINS_LOADED = [] # rubocop:disable Style/MutableConstant
@@project_dir = File.expand_path('../../..', __FILE__).untaint
def setup
super

View file

@ -4,6 +4,8 @@ require 'rubygems/command_manager'
class TestGemCommandManager < Gem::TestCase
@@project_dir = File.expand_path('../../..', __FILE__).untaint
def setup
super