diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_unpack_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_unpack_command.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/test/rubygems/test_gem_commands_unpack_command.rb b/test/rubygems/test_gem_commands_unpack_command.rb index 0fb4ef3843..8291a6b949 100644 --- a/test/rubygems/test_gem_commands_unpack_command.rb +++ b/test/rubygems/test_gem_commands_unpack_command.rb @@ -22,7 +22,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase assert_equal( @cmd.find_in_cache(@a1.file_name), - File.join(@gemhome, 'cache', @a1.file_name), + Gem.cache_gem(@a1.file_name, @gemhome), 'found a-1.gem in the cache' ) end @@ -34,7 +34,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase a1_data = nil - open File.join(@gemhome, 'cache', @a1.file_name), 'rb' do |fp| + open Gem.cache_gem(@a1.file_name, @gemhome), 'rb' do |fp| a1_data = fp.read end @@ -44,15 +44,15 @@ class TestGemCommandsUnpackCommand < Gem::TestCase dep = Gem::Dependency.new(@a1.name, @a1.version) assert_equal( @cmd.get_path(dep), - File.join(@gemhome, 'cache', @a1.file_name), + Gem.cache_gem(@a1.file_name, @gemhome), 'fetches a-1 and returns the cache path' ) - FileUtils.rm File.join(@gemhome, 'cache', @a1.file_name) + FileUtils.rm Gem.cache_gem(@a1.file_name, @gemhome) assert_equal( @cmd.get_path(dep), - File.join(@gemhome, 'cache', @a1.file_name), + Gem.cache_gem(@a1.file_name, @gemhome), 'when removed from cache, refetches a-1' ) end @@ -74,6 +74,8 @@ class TestGemCommandsUnpackCommand < Gem::TestCase def test_execute_gem_path util_make_gems + util_setup_spec_fetcher + util_setup_fake_fetcher Gem.clear_paths @@ -121,7 +123,7 @@ class TestGemCommandsUnpackCommand < Gem::TestCase util_clear_gems a2_data = nil - open File.join(@gemhome, 'cache', @a2.file_name), 'rb' do |fp| + open Gem.cache_gem(@a2.file_name, @gemhome), 'rb' do |fp| a2_data = fp.read end @@ -175,8 +177,8 @@ class TestGemCommandsUnpackCommand < Gem::TestCase end def test_execute_exact_match - foo_spec = quick_gem 'foo' - foo_bar_spec = quick_gem 'foo_bar' + foo_spec = quick_spec 'foo' + foo_bar_spec = quick_spec 'foo_bar' use_ui @ui do Dir.chdir @tempdir do |