diff options
Diffstat (limited to 'lib/rubygems/test_case.rb')
-rw-r--r-- | lib/rubygems/test_case.rb | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/rubygems/test_case.rb b/lib/rubygems/test_case.rb index 74cb4c98d1..e9916dad61 100644 --- a/lib/rubygems/test_case.rb +++ b/lib/rubygems/test_case.rb @@ -218,8 +218,11 @@ class Gem::TestCase < MiniTest::Unit::TestCase def setup super - @orig_gem_home = ENV['GEM_HOME'] - @orig_gem_path = ENV['GEM_PATH'] + @orig_gem_home = ENV['GEM_HOME'] + @orig_gem_path = ENV['GEM_PATH'] + @orig_gem_vendor = ENV['GEM_VENDOR'] + + ENV['GEM_VENDOR'] = nil @current_dir = Dir.pwd @fetcher = nil @@ -347,8 +350,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase FileUtils.rm_rf @tempdir unless ENV['KEEP_FILES'] - ENV['GEM_HOME'] = @orig_gem_home - ENV['GEM_PATH'] = @orig_gem_path + ENV['GEM_HOME'] = @orig_gem_home + ENV['GEM_PATH'] = @orig_gem_path + ENV['GEM_VENDOR'] = @orig_gem_vendor Gem.ruby = @orig_ruby if @orig_ruby @@ -1263,7 +1267,7 @@ Also, a list: # The StaticSet is a static set of gem specifications used for testing only. # It is available by requiring Gem::TestCase. - class StaticSet + class StaticSet < Gem::Resolver::Set ## # A StaticSet ignores remote because it has a fixed set of gems. @@ -1274,6 +1278,8 @@ Also, a list: # Creates a new StaticSet for the given +specs+ def initialize(specs) + super() + @specs = specs @remote = true @@ -1299,7 +1305,7 @@ Also, a list: # Finds all gems matching +dep+ in this set. def find_all(dep) - @specs.find_all { |s| dep.matches_spec? s } + @specs.find_all { |s| dep.match? s, @prerelease } end ## |