aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_uninstall_command.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-01 09:41:32 +0000
commit25a9b62d45ddd60a231272567c7dda9337da9b62 (patch)
treee72ba4c9c01cba5fb510eb1eafaba76d998baf4c /test/rubygems/test_gem_commands_uninstall_command.rb
parent86bb0af7ea3b50f72e6845a6f5f64cb1b23fd279 (diff)
downloadruby-25a9b62d45ddd60a231272567c7dda9337da9b62.tar.gz
Import rubygems 1.6.0 (released version @ 58d8a0b9)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_uninstall_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_uninstall_command.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/test/rubygems/test_gem_commands_uninstall_command.rb b/test/rubygems/test_gem_commands_uninstall_command.rb
index c5be3beb90..47f4960145 100644
--- a/test/rubygems/test_gem_commands_uninstall_command.rb
+++ b/test/rubygems/test_gem_commands_uninstall_command.rb
@@ -33,7 +33,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
end
end
- if win_platform?
+ if win_platform? then
assert File.exist?(@executable)
else
assert File.symlink?(@executable)
@@ -42,9 +42,9 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
# Evil hack to prevent false removal success
FileUtils.rm_f @executable
- open(@executable, "wb+") {|f| f.puts "binary"}
+ open @executable, "wb+" do |f| f.puts "binary" end
- @cmd.options[:args] = Array(@spec.name)
+ @cmd.options[:args] = [@spec.name]
use_ui @ui do
@cmd.execute
end
@@ -56,6 +56,25 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
assert_nil output.shift, "UI output should have contained only two lines"
end
+ def test_execute_removes_formatted_executable
+ FileUtils.rm_f @executable # Wish this didn't happen in #setup
+
+ Gem::Installer.exec_format = 'foo-%s-bar'
+
+ @installer.format_executable = true
+ @installer.install
+
+ formatted_executable = File.join @gemhome, 'bin', 'foo-executable-bar'
+ assert_equal true, File.exist?(formatted_executable)
+
+ @cmd.options[:format_executable] = true
+ @cmd.execute
+
+ assert_equal false, File.exist?(formatted_executable)
+ rescue
+ Gem::Installer.exec_format = nil
+ end
+
def test_execute_not_installed
@cmd.options[:args] = ["foo"]
e = assert_raises Gem::InstallError do
@@ -70,7 +89,7 @@ class TestGemCommandsUninstallCommand < Gem::InstallerTestCase
end
def test_execute_prerelease
- @spec = quick_gem "pre", "2.b"
+ @spec = quick_spec "pre", "2.b"
@gem = File.join @tempdir, @spec.file_name
FileUtils.touch @gem