diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-06-09 21:38:59 +0000 |
commit | 31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch) | |
tree | 10e44506238c7af3d7c9d822111996731726e38d /test/rubygems/test_gem_commands_contents_command.rb | |
parent | a6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff) | |
download | ruby-31c94ffeb5f09d09ac2c86fc9e6614e38251a43d.tar.gz |
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_commands_contents_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_contents_command.rb | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb index b891094ed8..a40be4e3fb 100644 --- a/test/rubygems/test_gem_commands_contents_command.rb +++ b/test/rubygems/test_gem_commands_contents_command.rb @@ -24,6 +24,27 @@ class TestGemCommandsContentsCommand < RubyGemTestCase assert_equal "", @ui.error end + def test_execute_all + @cmd.options[:all] = true + + quick_gem 'foo' do |gem| + gem.files = %w[lib/foo.rb Rakefile] + end + + quick_gem 'bar' do |gem| + gem.files = %w[lib/bar.rb Rakefile] + end + + use_ui @ui do + @cmd.execute + end + + assert_match %r|lib/foo\.rb|, @ui.output + assert_match %r|lib/bar\.rb|, @ui.output + assert_match %r|Rakefile|, @ui.output + assert_equal "", @ui.error + end + def test_execute_bad_gem @cmd.options[:args] = %w[foo] @@ -75,6 +96,48 @@ class TestGemCommandsContentsCommand < RubyGemTestCase assert_equal "", @ui.error end + def test_execute_multiple + @cmd.options[:args] = %w[foo bar] + quick_gem 'foo' do |gem| + gem.files = %w[lib/foo.rb Rakefile] + end + + quick_gem 'bar' do |gem| + gem.files = %w[lib/bar.rb Rakefile] + end + + use_ui @ui do + @cmd.execute + end + + assert_match %r|lib/foo\.rb|, @ui.output + assert_match %r|lib/bar\.rb|, @ui.output + assert_match %r|Rakefile|, @ui.output + assert_equal "", @ui.error + end + + def test_execute_no_prefix + @cmd.options[:args] = %w[foo] + @cmd.options[:prefix] = false + + quick_gem 'foo' do |gem| + gem.files = %w[lib/foo.rb Rakefile] + end + + use_ui @ui do + @cmd.execute + end + + expected = <<-EOF +lib/foo.rb +Rakefile + EOF + + assert_equal expected, @ui.output + + assert_equal "", @ui.error + end + def test_handle_options assert_equal false, @cmd.options[:lib_only] assert_equal [], @cmd.options[:specdirs] |