diff options
Diffstat (limited to 'Library/Homebrew/test')
| -rw-r--r-- | Library/Homebrew/test/test_formula.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb index 8f372f6f7..312b8245d 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/test/test_formula.rb @@ -367,4 +367,42 @@ class FormulaTests < Homebrew::TestCase [f1, f2, f3].each(&:clear_cache) f3.rack.rmtree end + + def test_pour_bottle + f_false = formula("foo") do + url "foo-1.0" + def pour_bottle? + false + end + end + refute f_false.pour_bottle? + + f_true = formula("foo") do + url "foo-1.0" + def pour_bottle? + true + end + end + assert f_true.pour_bottle? + end + + def test_pour_bottle_dsl + f_false = formula("foo") do + url "foo-1.0" + pour_bottle? do + reason "false reason" + satisfy { var == etc } + end + end + refute f_false.pour_bottle? + + f_true = formula("foo") do + url "foo-1.0" + pour_bottle? do + reason "true reason" + satisfy { var == var } + end + end + assert f_true.pour_bottle? + end end |
