diff options
| author | Jack Nagel | 2013-05-14 16:27:59 -0500 |
|---|---|---|
| committer | Jack Nagel | 2013-05-14 16:29:36 -0500 |
| commit | 4b2ea73f2e622bccd7143b4f1dd7994a6cfcee5f (patch) | |
| tree | 0fde64ad78b93613ec6602d36995283c439ba1a7 /Library | |
| parent | aece0a4e0a9b6ff99eacdceb87a0c547a6936c7f (diff) | |
| download | homebrew-4b2ea73f2e622bccd7143b4f1dd7994a6cfcee5f.tar.bz2 | |
test_keg: reduce noise by including FileUtils
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/test_keg.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Library/Homebrew/test/test_keg.rb b/Library/Homebrew/test/test_keg.rb index 5cf3a91d4..c8b0b8681 100644 --- a/Library/Homebrew/test/test_keg.rb +++ b/Library/Homebrew/test/test_keg.rb @@ -4,6 +4,8 @@ require 'keg' require 'stringio' class LinkTests < Test::Unit::TestCase + include FileUtils + def setup @formula = TestBall.new shutup do @@ -17,7 +19,7 @@ class LinkTests < Test::Unit::TestCase @old_stdout = $stdout $stdout = StringIO.new - FileUtils.mkpath HOMEBREW_PREFIX/"bin" + mkpath HOMEBREW_PREFIX/"bin" end def test_linking_keg @@ -49,28 +51,28 @@ class LinkTests < Test::Unit::TestCase end def test_linking_fails_when_files_exist - FileUtils.touch HOMEBREW_PREFIX/"bin/helloworld" + touch HOMEBREW_PREFIX/"bin/helloworld" assert_raise RuntimeError do shutup { @keg.link } end end def test_link_overwrite - FileUtils.touch HOMEBREW_PREFIX/"bin/helloworld" + touch HOMEBREW_PREFIX/"bin/helloworld" @mode.overwrite = true assert_equal 3, @keg.link(@mode) end def test_link_overwrite_broken_symlinks - FileUtils.cd HOMEBREW_PREFIX/"bin" do - FileUtils.ln_s "nowhere", "helloworld" + cd HOMEBREW_PREFIX/"bin" do + ln_s "nowhere", "helloworld" end @mode.overwrite = true assert_equal 3, @keg.link(@mode) end def test_link_overwrite_dryrun - FileUtils.touch HOMEBREW_PREFIX/"bin/helloworld" + touch HOMEBREW_PREFIX/"bin/helloworld" @mode.overwrite = true @mode.dry_run = true @@ -86,6 +88,6 @@ class LinkTests < Test::Unit::TestCase $stdout = @old_stdout - FileUtils.rmtree HOMEBREW_PREFIX/"bin" + rmtree HOMEBREW_PREFIX/"bin" end end |
