Skip to content

Commit 0dbc0bd

Browse files
committed
Fix CLI to use ARGV after dotopts has updated it. [bug]
1 parent 391afe0 commit 0dbc0bd

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

bin/ruby-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env ruby
22
begin
33
require 'rubytest'
4-
Test::CLI.run(*ARGV)
4+
Test::CLI.run
55
rescue RuntimeError => error
66
raise error if $DEBUG
77
$stderr.puts error

bin/rubytest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env ruby
22
begin
33
require 'rubytest'
4-
Test::CLI.run(*ARGV)
4+
Test::CLI.run
55
rescue RuntimeError => error
66
raise error if $DEBUG
77
$stderr.puts error

lib/rubytest/cli.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,17 @@ def config
2626
#
2727
# Run tests.
2828
#
29-
def run(*argv)
29+
def run(argv=nil)
3030
begin
3131
require 'dotopts'
3232
rescue LoadError
3333
end
3434

35-
options.parse!(argv)
35+
argv = (argv || ARGV.dup)
3636

37-
config.files.replace(argv) unless argv.empty?
37+
options.parse!(argv)
38+
39+
config.files.replace(argv) unless argv.empty?
3840

3941
Test.run(config)
4042

0 commit comments

Comments
 (0)