aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_bottle_hooks.rb1
-rw-r--r--Library/Homebrew/test/test_formula_installer.rb16
-rw-r--r--Library/Homebrew/test/test_formula_support.rb14
3 files changed, 31 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_bottle_hooks.rb b/Library/Homebrew/test/test_bottle_hooks.rb
index ff9d95c9c..1f889da17 100644
--- a/Library/Homebrew/test/test_bottle_hooks.rb
+++ b/Library/Homebrew/test/test_bottle_hooks.rb
@@ -6,6 +6,7 @@ class BottleHookTests < Homebrew::TestCase
class FormulaDouble
def bottle; end
def local_bottle_path; end
+ def bottle_disabled?; false end
def some_random_method
true
diff --git a/Library/Homebrew/test/test_formula_installer.rb b/Library/Homebrew/test/test_formula_installer.rb
index 1bf3e43ba..5c545692d 100644
--- a/Library/Homebrew/test/test_formula_installer.rb
+++ b/Library/Homebrew/test/test_formula_installer.rb
@@ -51,4 +51,20 @@ class InstallTests < Homebrew::TestCase
assert_equal 3, bin.children.length
end
end
+
+ def test_bottle_unneeded_formula_install
+ MacOS.stubs(:has_apple_developer_tools?).returns(false)
+
+ formula = Testball.new
+ formula.stubs(:bottle_unneeded?).returns(true)
+ formula.stubs(:bottle_disabled?).returns(true)
+
+ refute_predicate formula, :bottled?
+ assert_predicate formula, :bottle_unneeded?
+ assert_predicate formula, :bottle_disabled?
+
+ temporary_install(formula) do |f|
+ assert_predicate f, :installed?
+ end
+ end
end
diff --git a/Library/Homebrew/test/test_formula_support.rb b/Library/Homebrew/test/test_formula_support.rb
index 08d10292f..25514a032 100644
--- a/Library/Homebrew/test/test_formula_support.rb
+++ b/Library/Homebrew/test/test_formula_support.rb
@@ -11,3 +11,17 @@ class KegOnlyReasonTests < Homebrew::TestCase
assert_match(/^OS X already provides/, r.to_s)
end
end
+
+class BottleDisableReasonTests < Homebrew::TestCase
+ def test_bottle_unneeded
+ bottle_disable_reason = BottleDisableReason.new :unneeded, nil
+ assert_predicate bottle_disable_reason, :unneeded?
+ assert_equal "This formula doesn't require compiling.", bottle_disable_reason.to_s
+ end
+
+ def test_bottle_disabled
+ bottle_disable_reason = BottleDisableReason.new :disable, "reason"
+ refute_predicate bottle_disable_reason, :unneeded?
+ assert_equal "reason", bottle_disable_reason.to_s
+ end
+end