Skip to content

Commit

Permalink
- Fixed autotest --rc option handling. (simplybusiness)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/ZenTest/dev/": change = 6511]
  • Loading branch information
zenspider committed Aug 12, 2011
1 parent d81ab59 commit 0e39047
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/autotest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def self.parse_options args = ARGV
end

opts.on("-r", "--rc CONF", String, "Override path to config file") do |o|
options[:rc] = o
options[:rc] = Array(o)
end

opts.on("-s", "--style STYLE", String,
Expand Down
15 changes: 15 additions & 0 deletions test/test_autotest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ class Autotest
def self.clear_hooks
HOOKS.clear
end

def self.reset_options
@@options = {}
end
end

class TestAutotest < MiniTest::Unit::TestCase
Expand Down Expand Up @@ -465,6 +469,17 @@ def test_testlib
assert_match @a.testlib, @a.make_test_cmd(f)
end

def test_runner_accepts_rc_options
begin
Autotest.parse_options(['--rc', 'autotest_rc'])
Autotest.new
rescue
deny $!, "It should not throw #{$!.message}"
ensure
Autotest.reset_options
end
end

def util_exceptions
@a.exception_list.sort_by { |r| r.to_s }
end
Expand Down

0 comments on commit 0e39047

Please sign in to comment.