diff options
| author | Jack Nagel | 2014-06-23 21:48:15 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-23 22:34:41 -0500 |
| commit | 3be464cbc885e2c3255e7fe15df45869151955f8 (patch) | |
| tree | 9b7287d5b0911f56179effda6087e439fb07299f | |
| parent | f953bab9877f14d47a2b6c12e35c34b07a99c8cb (diff) | |
| download | homebrew-3be464cbc885e2c3255e7fe15df45869151955f8.tar.bz2 | |
Remove pin directory when empty
| -rw-r--r-- | Library/Homebrew/formula_pin.rb | 1 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_formula_pin.rb | 10 |
2 files changed, 5 insertions, 6 deletions
diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb index 969e8a4d2..842d108c2 100644 --- a/Library/Homebrew/formula_pin.rb +++ b/Library/Homebrew/formula_pin.rb @@ -23,6 +23,7 @@ class FormulaPin def unpin path.unlink if pinned? + PINDIR.rmdir_if_possible end def pinned? diff --git a/Library/Homebrew/test/test_formula_pin.rb b/Library/Homebrew/test/test_formula_pin.rb index 9478e54ea..6dbf3e173 100644 --- a/Library/Homebrew/test/test_formula_pin.rb +++ b/Library/Homebrew/test/test_formula_pin.rb @@ -27,19 +27,17 @@ class FormulaPinTests < Homebrew::TestCase assert_predicate @pin, :pinnable? end - def test_pin + def test_unpin (@f.rack+'0.1').mkpath @pin.pin + assert_predicate @pin, :pinned? assert_equal 1, FormulaPin::PINDIR.children.length - end - def test_unpin - (@f.rack+'0.1').mkpath - @pin.pin @pin.unpin + refute_predicate @pin, :pinned? - assert_equal 0, FormulaPin::PINDIR.children.length + refute_predicate FormulaPin::PINDIR, :directory? end def teardown |
