Silence stderr in test suite

This commit is contained in:
Jack Nagel 2013-04-01 12:15:29 -05:00
parent ad5b128fc7
commit cfe922ffd4
6 changed files with 15 additions and 15 deletions

View File

@ -63,7 +63,7 @@ class BeerTasting < Test::Unit::TestCase
end end
def test_zip def test_zip
nostdout { assert_nothing_raised { TestZip.new.brew {} } } shutup { assert_nothing_raised { TestZip.new.brew {} } }
end end
# needs resurrecting # needs resurrecting
@ -80,7 +80,7 @@ class BeerTasting < Test::Unit::TestCase
require 'cmd/prune' require 'cmd/prune'
require 'cleaner' require 'cleaner'
nostdout do shutup do
assert_nothing_raised do assert_nothing_raised do
f=TestBallWithRealPath.new f=TestBallWithRealPath.new
Homebrew.info_formula f Homebrew.info_formula f
@ -103,7 +103,7 @@ class BeerTasting < Test::Unit::TestCase
f3.instance_eval { @version = Version.new("0.3") } f3.instance_eval { @version = Version.new("0.3") }
f3.active_spec.instance_eval { @version = Version.new("0.3") } f3.active_spec.instance_eval { @version = Version.new("0.3") }
nostdout do shutup do
f1.brew { f1.install } f1.brew { f1.install }
f2.brew { f2.install } f2.brew { f2.install }
f3.brew { f3.install } f3.brew { f3.install }
@ -113,7 +113,7 @@ class BeerTasting < Test::Unit::TestCase
assert f2.installed? assert f2.installed?
assert f3.installed? assert f3.installed?
nostdout do shutup do
Homebrew.cleanup_formula f3 Homebrew.cleanup_formula f3
end end
@ -134,7 +134,7 @@ class BeerTasting < Test::Unit::TestCase
end end
def test_pathname_plus_yeast def test_pathname_plus_yeast
nostdout do shutup do
assert_nothing_raised do assert_nothing_raised do
assert !Pathname.getwd.rmdir_if_possible assert !Pathname.getwd.rmdir_if_possible
assert !Pathname.getwd.abv.empty? assert !Pathname.getwd.abv.empty?

View File

@ -3,12 +3,12 @@ require 'test/testball'
class ChecksumTests < Test::Unit::TestCase class ChecksumTests < Test::Unit::TestCase
def good_checksum f def good_checksum f
assert_nothing_raised { nostdout { f.brew {} } } assert_nothing_raised { shutup { f.brew {} } }
end end
def bad_checksum f def bad_checksum f
assert_raises ChecksumMismatchError do assert_raises ChecksumMismatchError do
nostdout { f.brew {} } shutup { f.brew {} }
end end
end end

View File

@ -20,7 +20,7 @@ end
class CleanerTests < Test::Unit::TestCase class CleanerTests < Test::Unit::TestCase
def test_clean_file def test_clean_file
f = CleanerTestBall.new f = CleanerTestBall.new
nostdout { f.brew { f.install } } shutup { f.brew { f.install } }
assert_nothing_raised { Cleaner.new f } assert_nothing_raised { Cleaner.new f }
assert_equal 0100555, (f.bin/'a.out').stat.mode assert_equal 0100555, (f.bin/'a.out').stat.mode

View File

@ -13,7 +13,7 @@ class FormulaTests < Test::Unit::TestCase
include VersionAssertions include VersionAssertions
def test_prefix def test_prefix
nostdout do shutup do
TestBall.new.brew do |f| TestBall.new.brew do |f|
assert_equal File.expand_path(f.prefix), (HOMEBREW_CELLAR+f.name+'0.1').to_s assert_equal File.expand_path(f.prefix), (HOMEBREW_CELLAR+f.name+'0.1').to_s
assert_kind_of Pathname, f.prefix assert_kind_of Pathname, f.prefix
@ -47,12 +47,12 @@ class FormulaTests < Test::Unit::TestCase
f=MostlyAbstractFormula.new f=MostlyAbstractFormula.new
assert_equal '__UNKNOWN__', f.name assert_equal '__UNKNOWN__', f.name
assert_raises(RuntimeError) { f.prefix } assert_raises(RuntimeError) { f.prefix }
nostdout { assert_raises(RuntimeError) { f.brew } } shutup { assert_raises(RuntimeError) { f.brew } }
end end
def test_mirror_support def test_mirror_support
HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist? HOMEBREW_CACHE.mkpath unless HOMEBREW_CACHE.exist?
nostdout do shutup do
f = TestBallWithMirror.new f = TestBallWithMirror.new
_, downloader = f.fetch _, downloader = f.fetch
assert_equal f.url, "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz" assert_equal f.url, "file:///#{TEST_FOLDER}/bad_url/testball-0.1.tbz"

View File

@ -31,7 +31,7 @@ end
class InstallTests < Test::Unit::TestCase class InstallTests < Test::Unit::TestCase
def temporary_install f def temporary_install f
# Brew and install the given formula # Brew and install the given formula
nostdout do shutup do
f.brew { f.install } f.brew { f.install }
end end
@ -80,7 +80,7 @@ class InstallTests < Test::Unit::TestCase
f=TestScriptFileFormula.new f=TestScriptFileFormula.new
temporary_install f do temporary_install f do
nostdout do shutup do
f.brew { f.install } f.brew { f.install }
end end

View File

@ -43,14 +43,14 @@ class LinkTests < Test::Unit::TestCase
def test_linking_fails_when_already_linked def test_linking_fails_when_already_linked
@keg.link @keg.link
assert_raise RuntimeError, "Cannot link testball" do assert_raise RuntimeError, "Cannot link testball" do
@keg.link shutup { @keg.link }
end end
end end
def test_linking_fails_when_files_exist def test_linking_fails_when_files_exist
FileUtils.touch HOMEBREW_PREFIX/"bin/helloworld" FileUtils.touch HOMEBREW_PREFIX/"bin/helloworld"
assert_raise RuntimeError do assert_raise RuntimeError do
@keg.link shutup { @keg.link }
end end
end end