Navigation Menu

Skip to content

Commit

Permalink
Avoid tmp/test gets expanded relative to chdir
Browse files Browse the repository at this point in the history
The usage of File.expand_path without a reference cause certain tests to
have a start point from inside itself due Dir.chdir.

Usage of __FILE__ as base to it makes tmp/test always start from the root
of the project.
  • Loading branch information
luislavena committed Oct 2, 2011
1 parent 91778ff commit 12f5af4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rubygems/test_case.rb
Expand Up @@ -120,7 +120,7 @@ def setup
@ui = Gem::MockGemUi.new

# Need to do this in the project because $SAFE fucks up _everything_
tmpdir = File.expand_path("tmp/test")
tmpdir = File.expand_path("../../../tmp/test", __FILE__)

if ENV['KEEP_FILES'] then
@tempdir = File.join(tmpdir, "test_rubygems_#{$$}.#{Time.now.to_i}")
Expand Down

0 comments on commit 12f5af4

Please sign in to comment.