ruby-changes:58497
From: Yusuke <ko1@a...>
Date: Tue, 29 Oct 2019 14:40:56 +0900 (JST)
Subject: [ruby-changes:58497] 7bf51ced55 (master): test/rubygems/test_gem.rb: early failure when there is /tmp/Gemfile
https://git.ruby-lang.org/ruby.git/commit/?id=7bf51ced55 From 7bf51ced5571d6180722f2be1b50c048a02b2e70 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Tue, 29 Oct 2019 14:34:31 +0900 Subject: test/rubygems/test_gem.rb: early failure when there is /tmp/Gemfile Some test cases in rubygems assume that /tmp/Gemfile does not exist. If it does, they fail with very difficult-to-understand message: ``` [ 149/2108] TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler = 0.00 1) Failure: TestGemBundlerVersionFinder#test_bundler_version_with_bundle_update_bundler [/home/mame/work/ruby/test/rubygems/test_gem_bundler_version_finder.rb:38]: Expected Gem::Version.new("2.0.2") to be nil. ``` I spent one hour to debug this issue. To prevent the same accident, this change makes the test suite stop when /tmp/Gemfile explicitly. diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 110eef6..23f8249 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -7,6 +7,10 @@ require 'pathname' https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem.rb#L7 require 'tmpdir' require 'rbconfig' +if File.exist?(File.join(Dir.tmpdir, "Gemfile")) + raise "rubygems/bundler tests do not work correctly if there is #{ File.join(Dir.tmpdir, "Gemfile") }" +end + # TODO: push this up to test_case.rb once battle tested $LOAD_PATH.map! do |path| -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/