1 require File.join(File.expand_path(File.dirname(__FILE__)),
2 'gem_installer_test_case')
3 require 'rubygems/uninstaller'
5 class TestGemUninstaller < GemInstallerTestCase
18 def test_initialize_expand_path
19 uninstaller = Gem::Uninstaller.new nil, :install_dir => '/foo//bar'
21 assert_match %r|/foo/bar$|, uninstaller.instance_variable_get(:@gem_home)
24 def test_remove_executables_force_keep
25 uninstaller = Gem::Uninstaller.new nil, :executables => false
28 uninstaller.remove_executables @spec
31 assert_equal true, File.exist?(File.join(@gemhome, 'bin', 'executable'))
33 assert_equal "Executables and scripts will remain installed.\n", @ui.output
36 def test_remove_executables_force_remove
37 uninstaller = Gem::Uninstaller.new nil, :executables => true
40 uninstaller.remove_executables @spec
43 assert_equal "Removing executable\n", @ui.output
45 assert_equal false, File.exist?(File.join(@gemhome, 'bin', 'executable'))
49 uninstaller = Gem::Uninstaller.new nil
51 assert_equal true, uninstaller.path_ok?(@spec)
54 def test_path_ok_eh_legacy
55 uninstaller = Gem::Uninstaller.new nil
57 @spec.loaded_from.gsub! @spec.full_name, '\&-legacy'
58 @spec.platform = 'legacy'
60 assert_equal true, uninstaller.path_ok?(@spec)