summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_commands_install_command.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2022-02-02 16:57:34 +0900
committerGitHub <noreply@github.com>2022-02-02 16:57:34 +0900
commit6794f8cf928ab8c009b301ec49a5a81e97e6eb2f (patch)
tree63f83daf2d1d2f57d6aaee9efa01e1c91ee8b021 /test/rubygems/test_gem_commands_install_command.rb
parent69463805f0722d90a2049f43e852539b4532bf2e (diff)
Merge pull request #5482 from hsbt/rubygems-3-3-bundler-2-3
Merge RubyGems 3.3.x and Bundler 2.3.x
Diffstat (limited to 'test/rubygems/test_gem_commands_install_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_install_command.rb16
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'