Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix operation on 1.8.x

Bump version
  • Loading branch information...
commit 8a08aec0bf4920b98cc579efca1589b6b21df478 1 parent 3070642
Erik Hollensbe authored
Showing with 14 additions and 5 deletions.
  1. +1 −1  lib/rubygems/commands/test_command.rb
  2. +13 −4 test/helper.rb
View
2  lib/rubygems/commands/test_command.rb
@@ -15,7 +15,7 @@ class Gem::Commands::TestCommand < Gem::Command
include Gem::VersionOption
include Gem::DefaultUserInteraction
- VERSION = "0.4.1"
+ VERSION = "0.4.2"
# taken straight out of rake
DEFAULT_RAKEFILES = ['rakefile', 'Rakefile', 'rakefile.rb', 'Rakefile.rb']
View
17 test/helper.rb
@@ -64,6 +64,16 @@ def set_configuration(hash)
Gem.configuration.verbose = false
end
+ def set_paths
+ if Gem::VERSION > '1.8'
+ Gem.paths = { :home => @gem_temp_path }
+ else
+ Gem.send :set_home, @gem_temp_path
+ end
+
+ Gem.refresh
+ end
+
def set_gem_temp_paths
@gem_temp_path = Dir.mktmpdir('rubygems-test')
@gem_home = Gem.dir
@@ -75,9 +85,8 @@ def set_gem_temp_paths
else
Gem.path.replace [@gem_temp_path]
end
- Gem.send :set_home, @gem_temp_path
- Gem.refresh
+ set_paths
end
def unset_gem_temp_paths
@@ -89,8 +98,8 @@ def unset_gem_temp_paths
else
Gem.path.replace @gem_paths
end
- Gem.send :set_home, @gem_home
- Gem.refresh
+
+ set_paths
end
def setup
Please sign in to comment.
Something went wrong with that request. Please try again.