From 4c2304f0004e9f1784540f3d36976aad9eab1f68 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 22 Jul 2013 22:46:50 +0000 Subject: * lib/rubygems: Import RubyGems from master as of commit b165260 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- .../rubygems/test_gem_commands_contents_command.rb | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/rubygems/test_gem_commands_contents_command.rb') diff --git a/test/rubygems/test_gem_commands_contents_command.rb b/test/rubygems/test_gem_commands_contents_command.rb index 35c9631959..d87e84fc82 100644 --- a/test/rubygems/test_gem_commands_contents_command.rb +++ b/test/rubygems/test_gem_commands_contents_command.rb @@ -91,6 +91,34 @@ class TestGemCommandsContentsCommand < Gem::TestCase assert_equal "", @ui.error end + def test_execute_missing_single + @cmd.options[:args] = %w[foo] + + assert_raises Gem::MockGemUi::TermError do + use_ui @ui do + @cmd.execute + end + end + + assert_match "Unable to find gem 'foo'", @ui.output + assert_empty @ui.error + end + + def test_execute_missing_multiple + @cmd.options[:args] = %w[foo bar] + + gem 'foo' + + use_ui @ui do + @cmd.execute + end + + assert_match "lib/foo.rb", @ui.output + assert_match "Unable to find gem 'bar'", @ui.output + + assert_empty @ui.error + end + def test_execute_multiple @cmd.options[:args] = %w[foo bar] -- cgit v1.2.3