diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 22:40:06 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-31 22:40:06 +0000 |
commit | 8cc45aae947d453acca029e13eb64f3f5f0bf942 (patch) | |
tree | f9485a20c99defe1aae3f32555a41d23c2298ad8 /test/rubygems/test_gem_uninstaller.rb | |
parent | dc8359969ec71ece10357ba9396430db7f029e45 (diff) | |
download | ruby-8cc45aae947d453acca029e13eb64f3f5f0bf942.tar.gz |
Import RubyGems 1.1.0
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_uninstaller.rb')
-rw-r--r-- | test/rubygems/test_gem_uninstaller.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_uninstaller.rb b/test/rubygems/test_gem_uninstaller.rb new file mode 100644 index 0000000000..d6e41814ed --- /dev/null +++ b/test/rubygems/test_gem_uninstaller.rb @@ -0,0 +1,43 @@ +require File.join(File.expand_path(File.dirname(__FILE__)), + 'gem_installer_test_case') +require 'rubygems/uninstaller' + +class TestGemUninstaller < GemInstallerTestCase + + def setup + super + + ui = MockGemUi.new + util_setup_gem ui + + use_ui ui do + @installer.install + end + end + + def test_remove_executables_force_keep + uninstaller = Gem::Uninstaller.new nil, :executables => false + + use_ui @ui do + uninstaller.remove_executables @spec + end + + assert_equal true, File.exist?(File.join(@gemhome, 'bin', 'executable')) + + assert_equal "Executables and scripts will remain installed.\n", @ui.output + end + + def test_remove_executables_force_remove + uninstaller = Gem::Uninstaller.new nil, :executables => true + + use_ui @ui do + uninstaller.remove_executables @spec + end + + assert_equal "Removing executable\n", @ui.output + + assert_equal false, File.exist?(File.join(@gemhome, 'bin', 'executable')) + end + +end + |