diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_update_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_update_command.rb | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/test/rubygems/test_gem_commands_update_command.rb b/test/rubygems/test_gem_commands_update_command.rb index 6aeb53d25a..11da1f8a83 100644 --- a/test/rubygems/test_gem_commands_update_command.rb +++ b/test/rubygems/test_gem_commands_update_command.rb @@ -14,14 +14,16 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase @a1_path = File.join @gemhome, 'cache', "#{@a1.full_name}.gem" @a2_path = File.join @gemhome, 'cache', "#{@a2.full_name}.gem" - @fetcher.data["#{@gem_repo}/Marshal.#{@marshal_version}"] = - @source_index.dump - @fetcher.data["#{@gem_repo}/gems/#{@a1.full_name}.gem"] = read_binary @a1_path - @fetcher.data["#{@gem_repo}/gems/#{@a2.full_name}.gem"] = read_binary @a2_path + util_setup_spec_fetcher @a1, @a2 + + @fetcher.data["#{@gem_repo}gems/#{@a1.full_name}.gem"] = + read_binary @a1_path + @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] = + read_binary @a2_path end def test_execute - util_remove_gems + util_clear_gems Gem::Installer.new(@a1_path).install @@ -33,7 +35,6 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase out = @ui.output.split "\n" assert_equal "Updating installed gems", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Updating #{@a2.name}", out.shift assert_equal "Successfully installed #{@a2.full_name}", out.shift assert_equal "Gems updated: #{@a2.name}", out.shift @@ -73,16 +74,15 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase util_build_gem @a2 util_build_gem @c2 - @fetcher.data["#{@gem_repo}/Marshal.#{@marshal_version}"] = - @source_index.dump - @fetcher.data["#{@gem_repo}/gems/#{@a1.full_name}.gem"] = read_binary @a1_path - @fetcher.data["#{@gem_repo}/gems/#{@a2.full_name}.gem"] = read_binary @a2_path - @fetcher.data["#{@gem_repo}/gems/#{@b2.full_name}.gem"] = read_binary @b2_path - @fetcher.data["#{@gem_repo}/gems/#{@c1_2.full_name}.gem"] = + @fetcher.data["#{@gem_repo}gems/#{@a1.full_name}.gem"] = read_binary @a1_path + @fetcher.data["#{@gem_repo}gems/#{@a2.full_name}.gem"] = read_binary @a2_path + @fetcher.data["#{@gem_repo}gems/#{@b2.full_name}.gem"] = read_binary @b2_path + @fetcher.data["#{@gem_repo}gems/#{@c1_2.full_name}.gem"] = read_binary @c1_2_path - @fetcher.data["#{@gem_repo}/gems/#{@c2.full_name}.gem"] = read_binary @c2_path + @fetcher.data["#{@gem_repo}gems/#{@c2.full_name}.gem"] = read_binary @c2_path - util_remove_gems + util_setup_spec_fetcher @a1, @a2, @b2, @c1_2, @c2 + util_clear_gems Gem::Installer.new(@c1_2_path).install Gem::Installer.new(@a1_path).install @@ -95,9 +95,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase out = @ui.output.split "\n" assert_equal "Updating installed gems", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Updating #{@a2.name}", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Successfully installed #{@c2.full_name}", out.shift assert_equal "Successfully installed #{@b2.full_name}", out.shift assert_equal "Successfully installed #{@a2.full_name}", out.shift @@ -108,7 +106,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase end def test_execute_named - util_remove_gems + util_clear_gems Gem::Installer.new(@a1_path).install @@ -120,7 +118,6 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase out = @ui.output.split "\n" assert_equal "Updating installed gems", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Updating #{@a2.name}", out.shift assert_equal "Successfully installed #{@a2.full_name}", out.shift assert_equal "Gems updated: #{@a2.name}", out.shift @@ -129,7 +126,7 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase end def test_execute_named_up_to_date - util_remove_gems + util_clear_gems Gem::Installer.new(@a2_path).install @@ -141,14 +138,13 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase out = @ui.output.split "\n" assert_equal "Updating installed gems", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Nothing to update", out.shift assert out.empty?, out.inspect end def test_execute_up_to_date - util_remove_gems + util_clear_gems Gem::Installer.new(@a2_path).install @@ -160,16 +156,10 @@ class TestGemCommandsUpdateCommand < RubyGemTestCase out = @ui.output.split "\n" assert_equal "Updating installed gems", out.shift - assert_match %r|Bulk updating|, out.shift assert_equal "Nothing to update", out.shift assert out.empty?, out.inspect end - def util_remove_gems - FileUtils.rm_r File.join(@gemhome, 'gems') - FileUtils.rm_r File.join(@gemhome, 'specifications') - end - end |