summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_query_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 07:19:10 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-19 07:19:10 +0000
commiteddc0685f224a6de2f5a6bdaab7f87562192ba7f (patch)
tree54f3427a70f2cc21e9dbbb6c3ad9ed500ea96865 /test/rubygems/test_gem_commands_query_command.rb
parent1b2be1f8ca5286a75d9401f96eaec89317353e3e (diff)
* lib/rubygems/commands/query_command.rb: Refactored to improve
maintainability. * test/rubygems/test_gem_commands_query_command.rb: Note default gems in gem list details. * lib/rubygems/uninstaller.rb: Detect all gems for uninstallation. This allows duplicate installs of default gems to be removed. * lib/rubygems/specification.rb: Allow use of ::each_spec. * lib/rubygems/test_case.rb: Added install_default_gems. * test/rubygems/test_gem_commands_uninstall_command.rb: Moved test down to the uninstaller tests. * test/rubygems/test_gem_uninstaller.rb: Test for uninstallation of default gems and duplicate default gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_query_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb44
1 files changed, 38 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb
index 8ff62b4217..09e6efcd07 100644
--- a/test/rubygems/test_gem_commands_query_command.rb
+++ b/test/rubygems/test_gem_commands_query_command.rb
@@ -106,7 +106,6 @@ pl (1 i386-linux)
@a2.summary = 'This is a lot of text. ' * 4
@a2.authors = ['Abraham Lincoln', 'Hirohito']
@a2.homepage = 'http://a.example.com/'
- @a2.rubyforge_project = 'rubygems'
util_clear_gems
util_setup_spec_fetcher @a1, @a2, @pl1
@@ -123,7 +122,6 @@ pl (1 i386-linux)
a (2)
Authors: Abraham Lincoln, Hirohito
- Rubyforge: http://rubyforge.org/projects/rubygems
Homepage: http://a.example.com/
This is a lot of text. This is a lot of text. This is a lot of text.
@@ -147,7 +145,6 @@ pl (1)
@a2.summary = 'This is a lot of text. ' * 4
@a2.authors = ['Abraham Lincoln', 'Hirohito']
@a2.homepage = 'http://a.example.com/'
- @a2.rubyforge_project = 'rubygems'
@a2.platform = 'universal-darwin'
util_clear_gems
@@ -168,7 +165,6 @@ a (2, 1)
1: x86-linux
2: universal-darwin
Authors: Abraham Lincoln, Hirohito
- Rubyforge: http://rubyforge.org/projects/rubygems
Homepage: http://a.example.com/
This is a lot of text. This is a lot of text. This is a lot of text.
@@ -355,7 +351,6 @@ pl (1 i386-linux)
@a2.summary = 'This is a lot of text. ' * 4
@a2.authors = ['Abraham Lincoln', 'Hirohito']
@a2.homepage = 'http://a.example.com/'
- @a2.rubyforge_project = 'rubygems'
@a2.platform = 'universal-darwin'
util_clear_gems
@@ -380,7 +375,6 @@ a (2, 1)
1: x86-linux
2: universal-darwin
Authors: Abraham Lincoln, Hirohito
- Rubyforge: http://rubyforge.org/projects/rubygems
Homepage: http://a.example.com/
Installed at -
-
@@ -400,5 +394,43 @@ pl \(1\)
assert_match expected, @ui.output
end
+ def test_execute_default_details
+ default_gem_dir = Gem::Specification.default_specifications_dir
+ @a1.loaded_from =
+ File.join default_gem_dir, @a1.spec_name
+
+ @cmd.handle_options %w[-l -d]
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ str = @ui.output
+
+ expected = <<-EOF
+
+*** LOCAL GEMS ***
+
+a (3.a, 2, 1)
+ Author: A User
+ Homepage: http://example.com
+ Installed at (3.a): #{@gemhome}
+ (2): #{@gemhome}
+ (1, default): #{@a1.base_dir}
+
+ this is a summary
+
+pl \(1\)
+ Platform: i386-linux
+ Author: A User
+ Homepage: http://example.com
+ Installed at: #{@gemhome}
+
+ this is a summary
+ EOF
+
+ assert_equal expected, @ui.output
+ end
+
end