Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

The proper API is now used with Updating RubyGems when gem names are …

…provided
  • Loading branch information...
commit 7f3dceed908dc67d6fb4a90ff523ae4edb1b5706 1 parent dbc3a08
@drbrain drbrain authored lsegal committed
View
3  lib/rubygems/commands/update_command.rb
@@ -130,7 +130,8 @@ def update_gems gems_to_update
def update_rubygems
unless options[:args].empty? then
- raise "No gem names are allowed with the --system option"
+ alert_error "Gem names are not allowed with the --system option"
+ terminate_interaction 1
end
options[:user_install] = false
View
21 test/test_gem_commands_update_command.rb
@@ -145,6 +145,27 @@ def test_execute_system_specific
assert_empty out
end
+ def test_execute_system_with_gems
+ util_setup_rubygem9
+ util_setup_spec_fetcher @rubygem9
+ util_clear_gems
+
+ @cmd.options[:args] = %w[gem]
+ @cmd.options[:system] = true
+ @cmd.options[:generate_rdoc] = false
+ @cmd.options[:generate_ri] = false
+
+ assert_raises Gem::MockGemUi::TermError do
+ use_ui @ui do
+ @cmd.execute
+ end
+ end
+
+ assert_empty @ui.output
+ assert_equal "ERROR: Gem names are not allowed with the --system option\n",
+ @ui.error
+ end
+
# before:
# a1 -> c1.2
# after:
Please sign in to comment.
Something went wrong with that request. Please try again.