diff options
author | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 23:46:47 +0000 |
---|---|---|
committer | ryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 23:46:47 +0000 |
commit | 934f537b458778f4786716c95b73fc72bc1ce256 (patch) | |
tree | 6abdecd9956995a7f82c9f969c80657b4301f6bd /test/rubygems/test_gem_uninstaller.rb | |
parent | b511e1bfbe649b938e317e00ad1795f1b9623758 (diff) | |
download | ruby-934f537b458778f4786716c95b73fc72bc1ce256.tar.gz |
Import rubygems 1.5.0 (release candidate @ 09893d9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_uninstaller.rb')
-rw-r--r-- | test/rubygems/test_gem_uninstaller.rb | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/test/rubygems/test_gem_uninstaller.rb b/test/rubygems/test_gem_uninstaller.rb index 9d42d9bcde..3925ab1a63 100644 --- a/test/rubygems/test_gem_uninstaller.rb +++ b/test/rubygems/test_gem_uninstaller.rb @@ -4,31 +4,28 @@ # File a patch instead and assign it to Ryan Davis or Eric Hodel. ###################################################################### -require "test/rubygems/gem_installer_test_case" +require 'rubygems/installer_test_case' require 'rubygems/uninstaller' -class TestGemUninstaller < GemInstallerTestCase +class TestGemUninstaller < Gem::InstallerTestCase def setup super - ui = MockGemUi.new - util_setup_gem ui - @user_spec.executables = ["my_exec"] # HACK util_make_exec user_bin_dir = File.join Gem.user_dir, 'gems', @user_spec.full_name, 'bin' FileUtils.mkdir_p user_bin_dir exec_path = File.join user_bin_dir, "my_exec" - File.open exec_path, 'w' do |f| + open exec_path, 'w' do |f| f.puts "#!/usr/bin/ruby" end user_bin_dir = File.join Gem.user_dir, 'bin' FileUtils.mkdir_p user_bin_dir exec_path = File.join user_bin_dir, "my_exec" - File.open exec_path, 'w' do |f| + open exec_path, 'w' do |f| f.puts "#!/usr/bin/ruby" end @@ -50,11 +47,14 @@ class TestGemUninstaller < GemInstallerTestCase def test_remove_executables_force_keep uninstaller = Gem::Uninstaller.new nil, :executables => false + executable = File.join Gem.user_dir, 'bin', 'my_exec' + assert File.exist? executable + use_ui @ui do - uninstaller.remove_executables @spec + uninstaller.remove_executables @user_spec end - assert_equal true, File.exist?(File.join(@gemhome, 'bin', 'executable')) + assert File.exist? executable assert_equal "Executables and scripts will remain installed.\n", @ui.output end @@ -62,13 +62,16 @@ class TestGemUninstaller < GemInstallerTestCase def test_remove_executables_force_remove uninstaller = Gem::Uninstaller.new nil, :executables => true + executable = File.join Gem.user_dir, 'bin', 'my_exec' + assert File.exist? executable + use_ui @ui do - uninstaller.remove_executables @spec + uninstaller.remove_executables @user_spec end - assert_equal "Removing executable\n", @ui.output + assert_equal "Removing my_exec\n", @ui.output - assert_equal false, File.exist?(File.join(@gemhome, 'bin', 'executable')) + refute File.exist? executable end def test_remove_executables_user |