fix tests failing when verbose set

This commit is contained in:
Bruce Steedman 2016-09-30 18:41:54 +01:00
parent 41b2df8e33
commit 540347a42c
3 changed files with 8 additions and 2 deletions

View File

@ -22,11 +22,13 @@ 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
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
end

View File

@ -5,6 +5,10 @@ class IntegrationCommandTestOutdated < IntegrationCommandTestCase
setup_test_formula "testball"
(HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
if ARGV.verbose?
assert_equal "testball (0.0.1) < 0.1", cmd("outdated")
else
assert_equal "testball", cmd("outdated")
end
end
end

View File

@ -117,7 +117,7 @@ class ResourceTests < Homebrew::TestCase
end
def test_verify_download_integrity_mismatch
fn = stub(file?: true)
fn = stub(file?: true, basename: "Ftest")
checksum = @resource.sha256(TEST_SHA256)
fn.expects(:verify_checksum).with(checksum)