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/Homebrew/download_strategy.rb | 5 +++- Library/Homebrew/pathname+yeast.rb | 23 ++++++++----------- Library/Homebrew/unittest.rb | 43 +++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 14 deletions(-) (limited to 'Library/Homebrew') diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 75dd60d36..341bdb765 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -55,7 +55,10 @@ class HttpDownloadStrategy 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