aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJoshua Peek2009-12-31 09:44:01 -0600
committerMax Howell2010-01-18 08:27:55 +0000
commit8585a7598e8ee015a52b60168e385601adc6c40e (patch)
tree3241b885b3eed89917f81c8e048c881de0cbff43 /Library
parentffd39835ec005a783fffdd5ef0bca2754f3117ad (diff)
downloadhomebrew-8585a7598e8ee015a52b60168e385601adc6c40e.tar.bz2
Unit test for `brew cleanup`
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Homebrew/test/unittest.rb29
1 files changed, 28 insertions, 1 deletions
diff --git a/Library/Homebrew/test/unittest.rb b/Library/Homebrew/test/unittest.rb
index 8e4696fc0..c69dd5ad4 100755
--- a/Library/Homebrew/test/unittest.rb
+++ b/Library/Homebrew/test/unittest.rb
@@ -471,7 +471,34 @@ class BeerTasting <Test::Unit::TestCase
end
end
end
-
+
+ def test_brew_cleanup
+ f1=TestBall.new
+ f1.instance_eval { @version = "0.1" }
+ f2=TestBall.new
+ f2.instance_eval { @version = "0.2" }
+ f3=TestBall.new
+ f3.instance_eval { @version = "0.3" }
+
+ nostdout do
+ f1.brew { f1.install }
+ f2.brew { f2.install }
+ f3.brew { f3.install }
+ end
+
+ assert f1.installed?
+ assert f2.installed?
+ assert f3.installed?
+
+ nostdout do
+ cleanup f3
+ end
+
+ assert !f1.installed?
+ assert !f2.installed?
+ assert f3.installed?
+ end
+
def test_my_float_assumptions
# this may look ridiculous but honestly there's code in brewit that depends on
# this behaviour so I wanted to be certain Ruby floating points are behaving