aboutsummaryrefslogtreecommitdiffstats
path: root/test/rubygems/test_gem_commands_query_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rubygems/test_gem_commands_query_command.rb')
-rw-r--r--test/rubygems/test_gem_commands_query_command.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_commands_query_command.rb b/test/rubygems/test_gem_commands_query_command.rb
index b79d13d270..a7e5e01f09 100644
--- a/test/rubygems/test_gem_commands_query_command.rb
+++ b/test/rubygems/test_gem_commands_query_command.rb
@@ -195,6 +195,34 @@ pl (1)
assert_equal '', @ui.error
end
+ def test_execute_installed_inverse
+ @cmd.handle_options %w[-n a --no-installed]
+
+ e = assert_raises Gem::MockGemUi::TermError do
+ use_ui @ui do
+ @cmd.execute
+ end
+ end
+
+ assert_equal "false\n", @ui.output
+ assert_equal '', @ui.error
+
+ assert_equal 1, e.exit_code
+ end
+
+ def test_execute_installed_inverse_not_installed
+ @cmd.handle_options %w[-n not_installed --no-installed]
+
+ assert_raises Gem::MockGemUi::SystemExitException do
+ use_ui @ui do
+ @cmd.execute
+ end
+ end
+
+ assert_equal "true\n", @ui.output
+ assert_equal '', @ui.error
+ end
+
def test_execute_installed_no_name
@cmd.handle_options %w[--installed]