[rubygems/rubygems] Specify explicit separator not to be affected by $;
https://github.com/rubygems/rubygems/commit/1cea3d4dce
This commit is contained in:
parent
241950b1c5
commit
6e80cabb90
Notes:
git
2020-05-08 14:14:16 +09:00
@ -77,7 +77,7 @@ class Gem::Command
|
|||||||
when Array
|
when Array
|
||||||
@extra_args = value
|
@extra_args = value
|
||||||
when String
|
when String
|
||||||
@extra_args = value.split
|
@extra_args = value.split(' ')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -57,6 +57,27 @@ class TestGemCommand < Gem::TestCase
|
|||||||
assert_equal [], h
|
assert_equal [], h
|
||||||
end
|
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
|
def test_basic_accessors
|
||||||
assert_equal "doit", @cmd.command
|
assert_equal "doit", @cmd.command
|
||||||
assert_equal "gem doit", @cmd.program_name
|
assert_equal "gem doit", @cmd.program_name
|
||||||
|
Loading…
x
Reference in New Issue
Block a user