summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-03-08 17:38:37 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit6e80cabb90cec19db24cf4e19fcd4e65cdf41e70 (patch)
tree378bdc703b8c81d5777cb8d39f88d3d82371a3ae /test
parent241950b1c546924c54ad9df3d67ba9c4f566c35b (diff)
[rubygems/rubygems] Specify explicit separator not to be affected by $;
https://github.com/rubygems/rubygems/commit/1cea3d4dce
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem_command.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_command.rb b/test/rubygems/test_gem_command.rb
index c3f057f2ff..44ec324ab9 100644
--- a/test/rubygems/test_gem_command.rb
+++ b/test/rubygems/test_gem_command.rb
@@ -57,6 +57,27 @@ class TestGemCommand < Gem::TestCase
assert_equal [], h
end
+ def test_self_extra_args
+ verbose, $VERBOSE, separator = $VERBOSE, nil, $;
+ extra_args = Gem::Command.extra_args
+
+ Gem::Command.extra_args = %w[--all]
+ assert_equal %w[--all], Gem::Command.extra_args
+
+ Gem::Command.extra_args = "--file --help"
+ assert_equal %w[--file --help], Gem::Command.extra_args
+
+ $; = "="
+
+ Gem::Command.extra_args = "--awesome=true --verbose"
+ assert_equal %w[--awesome=true --verbose], Gem::Command.extra_args
+
+ ensure
+ Gem::Command.extra_args = extra_args
+ $; = separator
+ $VERBOSE = verbose
+ end
+
def test_basic_accessors
assert_equal "doit", @cmd.command
assert_equal "gem doit", @cmd.program_name