[ruby/getoptlong] Save the copy of ARGV

It refers the same object and will be replaced.

5f57f47572
This commit is contained in:
Nobuyoshi Nakada 2021-11-11 11:07:26 +09:00 committed by Hiroshi SHIBATA
parent f5dcecf345
commit 6ecd30b402

View file

@ -5,7 +5,7 @@ class TestGetoptLong < Test::Unit::TestCase
def verify(test_argv, expected_remaining_argv, expected_options) def verify(test_argv, expected_remaining_argv, expected_options)
# Save ARGV and replace it with a test ARGV. # Save ARGV and replace it with a test ARGV.
argv_saved = ARGV argv_saved = ARGV.dup
ARGV.replace(test_argv) ARGV.replace(test_argv)
# Define options. # Define options.
opts = GetoptLong.new( opts = GetoptLong.new(