aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_dependency_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 18:15:26 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-19 18:15:26 +0000
commit08837d081d764af01a30d325007c3c9527e383a6 (patch)
tree227a49d530df51dd8f00972a4637bd568a3ca717 /test/rubygems/test_gem_commands_dependency_command.rb
parent4394ffe521ca03b22761ce4d4afed6645a62ea3d (diff)
downloadruby-08837d081d764af01a30d325007c3c9527e383a6.tar.gz
Update to RubyGems 1.1.1 r1784 (pre 1.2)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_dependency_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_dependency_command.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_dependency_command.rb b/test/rubygems/test_gem_commands_dependency_command.rb
index 93e772c691..e143110a71 100644
--- a/test/rubygems/test_gem_commands_dependency_command.rb
+++ b/test/rubygems/test_gem_commands_dependency_command.rb
@@ -30,6 +30,34 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
assert_equal '', @ui.error
end
+ def test_execute_no_args
+ Gem.source_index = nil
+
+ @cmd.options[:args] = []
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ expected = <<-EOF
+Gem a-1
+
+Gem a-2
+
+Gem a_evil-9
+
+Gem b-2
+
+Gem c-1.2
+
+Gem pl-1-x86-linux
+
+ EOF
+
+ assert_equal expected, @ui.output
+ assert_equal '', @ui.error
+ end
+
def test_execute_no_match
@cmd.options[:args] = %w[foo]
@@ -59,6 +87,30 @@ class TestGemCommandsDependencyCommand < RubyGemTestCase
assert_equal '', @ui.error
end
+ def test_execute_regexp
+ Gem.source_index = nil
+
+ @cmd.options[:args] = %w[/[ab]/]
+
+ use_ui @ui do
+ @cmd.execute
+ end
+
+ expected = <<-EOF
+Gem a-1
+
+Gem a-2
+
+Gem a_evil-9
+
+Gem b-2
+
+ EOF
+
+ assert_equal expected, @ui.output
+ assert_equal '', @ui.error
+ end
+
def test_execute_reverse
quick_gem 'foo' do |gem|
gem.add_dependency 'bar', '> 1'