diff options
Diffstat (limited to 'test/rubygems/test_gem_commands_install_command.rb')
-rw-r--r-- | test/rubygems/test_gem_commands_install_command.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_install_command.rb b/test/rubygems/test_gem_commands_install_command.rb index 0365b2c408..47a97dae4b 100644 --- a/test/rubygems/test_gem_commands_install_command.rb +++ b/test/rubygems/test_gem_commands_install_command.rb @@ -277,6 +277,22 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a assert_match(/ould not find a valid gem 'nonexistent'/, @ui.error) end + def test_execute_nonexistent_force + spec_fetcher + + @cmd.options[:args] = %w[nonexistent] + @cmd.options[:force] = true + + use_ui @ui do + e = assert_raise Gem::MockGemUi::TermError do + @cmd.execute + end + assert_equal 2, e.exit_code + end + + assert_match(/ould not find a valid gem 'nonexistent'/, @ui.error) + end + def test_execute_dependency_nonexistent spec_fetcher do |fetcher| fetcher.spec 'foo', 2, 'bar' => '0.5' |