diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/rubygems/test_case.rb | 11 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 18 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Fri Apr 22 18:13:22 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] + Fri Apr 22 16:37:14 2016 multisnow <infinity.blick.winkel@gmail.com> * ext/openssl/extconf.rb: check RAND_edg to support libressl. diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 5dc7a1b67c..cd83453e14 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -250,6 +250,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' @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.2.5" #define RUBY_RELEASE_DATE "2016-04-22" -#define RUBY_PATCHLEVEL 306 +#define RUBY_PATCHLEVEL 307 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 4 |