diff options
| author | Bruce Steedman | 2016-10-01 09:26:25 +0100 |
|---|---|---|
| committer | Bruce Steedman | 2016-10-01 09:26:25 +0100 |
| commit | df7246fdea9479d1131473b0babbecf35558dfda (patch) | |
| tree | a6068b79ab136df841ad2a0e215dfa75de9d66f7 | |
| parent | d843f70a3501e05d81777ef9d0e8612fcaa1a659 (diff) | |
| download | brew-df7246fdea9479d1131473b0babbecf35558dfda.tar.bz2 | |
make assertions conditional on ARGV.verbose?
| -rw-r--r-- | Library/Homebrew/test/test_download_strategies.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/test_download_strategies.rb index 99c4ad1af..e34940185 100644 --- a/Library/Homebrew/test/test_download_strategies.rb +++ b/Library/Homebrew/test/test_download_strategies.rb @@ -22,15 +22,21 @@ class AbstractDownloadStrategyTests < Homebrew::TestCase def test_expand_safe_system_args_with_explicit_quiet_flag @args << { quiet_flag: "--flag" } - ARGV.stubs(verbose?: false) expanded_args = @strategy.expand_safe_system_args(@args) - assert_equal %w[foo bar baz --flag], expanded_args + if ARGV.verbose? + assert_equal %w[foo bar baz], expanded_args + else + assert_equal %w[foo bar baz --flag], expanded_args + end end def test_expand_safe_system_args_with_implicit_quiet_flag - ARGV.stubs(verbose?: false) expanded_args = @strategy.expand_safe_system_args(@args) - assert_equal %w[foo bar -q baz], expanded_args + if ARGV.verbose? + assert_equal %w[foo bar baz], expanded_args + else + assert_equal %w[foo bar -q baz], expanded_args + end end def test_expand_safe_system_args_does_not_mutate_argument |
