From 6bf2dcc5c1c23bc04166ab2b75c04a8bd3876ffd Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 2 Sep 2009 14:31:28 +0100 Subject: Tests for Pathname+Yeast I removed the rename and mv functions as when I wrote the tests I realised the function implied the pathname object would be updated to reflect the moved or renamed file. However that cannot be done. Also frankly I think writing it out in full makes clearer code. --- Library/Formula/flac.rb | 2 -- Library/Homebrew/download_strategy.rb | 5 +++- Library/Homebrew/pathname+yeast.rb | 23 ++++++++----------- Library/Homebrew/unittest.rb | 43 +++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 16 deletions(-) (limited to 'Library') diff --git a/Library/Formula/flac.rb b/Library/Formula/flac.rb index 1c8fc4b1a..eaca70344 100644 --- a/Library/Formula/flac.rb +++ b/Library/Formula/flac.rb @@ -21,8 +21,6 @@ class Flac e raise unless e.errno == Errno::ENOTEMPTY::Errno or e.errno == Errno::EACCES::Errno + false end def chmod_R perms @@ -96,7 +90,10 @@ class Pathname end def abv - `find #{to_s} -type f | wc -l`.strip+' files, '+`du -hd0 #{to_s} | cut -d"\t" -f1`.strip + out='' + n=`find #{to_s} -type f | wc -l`.to_i + out<<"#{n} files, " if n > 1 + out<<`du -hd0 #{to_s} | cut -d"\t" -f1`.strip end def version diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb index 7a3d70ac5..7943640fd 100755 --- a/Library/Homebrew/unittest.rb +++ b/Library/Homebrew/unittest.rb @@ -362,4 +362,47 @@ class BeerTasting