diff options
Diffstat (limited to 'Library')
| -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 |
