aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_formula.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/test_formula.rb
index 7c09e765f..2eb64ebb6 100644
--- a/Library/Homebrew/test/test_formula.rb
+++ b/Library/Homebrew/test/test_formula.rb
@@ -248,6 +248,32 @@ class FormulaTests < Homebrew::TestCase
assert_nil Testball.new <=> Object.new
end
+ def test_alias_paths_with_build_options
+ alias_path = CoreTap.instance.alias_dir/"another_name"
+ f = formula(:alias_path => alias_path) { url "foo-1.0" }
+ f.build = BuildOptions.new({}, {})
+ assert_equal alias_path, f.alias_path
+ assert_nil f.installed_alias_path
+ end
+
+ def test_alias_paths_with_tab_with_non_alias_source_path
+ alias_path = CoreTap.instance.alias_dir/"another_name"
+ source_path = CoreTap.instance.formula_dir/"another_other_name"
+ f = formula(:alias_path => alias_path) { url "foo-1.0" }
+ f.build = Tab.new(:source => { "path" => source_path.to_s })
+ assert_equal alias_path, f.alias_path
+ assert_nil f.installed_alias_path
+ end
+
+ def test_alias_paths_with_tab_with_alias_source_path
+ alias_path = CoreTap.instance.alias_dir/"another_name"
+ source_path = CoreTap.instance.alias_dir/"another_other_name"
+ f = formula(:alias_path => alias_path) { url "foo-1.0" }
+ f.build = Tab.new(:source => { "path" => source_path.to_s })
+ assert_equal alias_path, f.alias_path
+ assert_equal source_path.to_s, f.installed_alias_path
+ end
+
def test_formula_spec_integration
f = formula do
homepage "http://example.com"