mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rubygems/test_case.rb: Fix test on Windows for inconsistent temp path.
https://github.com/rubygems/rubygems/pull/1554 [Bug #12193][ruby-core:74431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7d378a5b3a
commit
6cc4937aec
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Mar 28 11:02:31 2016 Hiroshi Shirosaki <h.shirosaki@gmail.com>
|
||||
|
||||
* lib/rubygems/test_case.rb: Fix test on Windows for inconsistent temp path.
|
||||
https://github.com/rubygems/rubygems/pull/1554
|
||||
[Bug #12193][ruby-core:74431]
|
||||
|
||||
Mon Mar 28 08:19:49 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* sprintf.c (rb_str_format): refactor floating point format of
|
||||
|
|
|
@ -252,6 +252,17 @@ class Gem::TestCase < MiniTest::Unit::TestCase
|
|||
@tempdir.untaint
|
||||
end
|
||||
|
||||
# This makes the tempdir consistent on Windows.
|
||||
# Dir.tmpdir may return short path name, but Dir[Dir.tmpdir] returns long
|
||||
# path name. https://bugs.ruby-lang.org/issues/10819
|
||||
# File.expand_path or File.realpath doesn't convert path name to long path
|
||||
# name. Only Dir[] (= Dir.glob) works.
|
||||
# Short and long path name is specific to Windows filesystem.
|
||||
if win_platform?
|
||||
@tempdir = Dir[@tempdir][0]
|
||||
@tempdir.untaint
|
||||
end
|
||||
|
||||
@gemhome = File.join @tempdir, 'gemhome'
|
||||
@userhome = File.join @tempdir, 'userhome'
|
||||
ENV["GEM_SPEC_CACHE"] = File.join @tempdir, 'spec_cache'
|
||||
|
|
Loading…
Add table
Reference in a new issue