summaryrefslogtreecommitdiff
path: root/test/rubygems
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2021-06-14 12:55:30 +0900
committernagachika <nagachika@ruby-lang.org>2021-07-07 10:03:15 +0900
commitf63d3bbb6e27daaac8211c57929d62add4fef1ad (patch)
treee3fa1606e7c7ce3612cbe355dfd9d53da18b3356 /test/rubygems
parentd4b4281959d2a9846d766253b5e21e8158948aa7 (diff)
Merge RubyGems-3.2.19 and Bundler-2.2.19
Diffstat (limited to 'test/rubygems')
-rw-r--r--test/rubygems/test_gem_command.rb12
-rw-r--r--test/rubygems/test_gem_commands_help_command.rb7
2 files changed, 19 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb
index a99de30b33..4d0c4eb5e8 100644
--- a/test/rubygems/test_gem_command.rb
+++ b/test/rubygems/test_gem_command.rb
@@ -189,6 +189,18 @@ class TestGemCommand < Gem::TestCase
assert_match %r{Usage: gem doit}, @ui.output
end
+ def test_add_option
+ assert_nothing_raised RuntimeError do
+ @cmd.add_option('--force', 'skip validation of the spec') {|v,o| }
+ end
+ end
+
+ def test_add_option_with_empty
+ assert_raise RuntimeError, "Do not pass an empty string in opts" do
+ @cmd.add_option('', 'skip validation of the spec') {|v,o| }
+ end
+ end
+
def test_option_recognition
@cmd.add_option('-h', '--help [COMMAND]', 'Get help on COMMAND') do |value, options|
options[:help] = true
diff --git a/test/rubygems/test_gem_commands_help_command.rb b/test/rubygems/test_gem_commands_help_command.rb
index 24cf2d2250..128db5db1f 100644
--- a/test/rubygems/test_gem_commands_help_command.rb
+++ b/test/rubygems/test_gem_commands_help_command.rb
@@ -35,6 +35,13 @@ class TestGemCommandsHelpCommand < Gem::TestCase
end
end
+ def test_gem_help_build
+ util_gem 'build' do |out, err|
+ assert_match(/-C PATH *Run as if gem build was started in <PATH>/, out)
+ assert_equal '', err
+ end
+ end
+
def test_gem_help_commands
mgr = Gem::CommandManager.new