aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/formula_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/test/formula_spec.rb')
-rw-r--r--Library/Homebrew/test/formula_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb
index 1e064912f..2309c36fb 100644
--- a/Library/Homebrew/test/formula_spec.rb
+++ b/Library/Homebrew/test/formula_spec.rb
@@ -129,6 +129,8 @@ describe Formula do
alias_name = "bar"
alias_path = "#{CoreTap.instance.alias_dir}/#{alias_name}"
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf f.path, alias_path
f.build = Tab.new(source: { "path" => alias_path })
@@ -160,6 +162,8 @@ describe Formula do
alias_name = "bar"
full_alias_name = "#{tap.user}/#{tap.repo}/#{alias_name}"
alias_path = "#{tap.alias_dir}/#{alias_name}"
+ tap.alias_dir.mkpath
+ FileUtils.ln_sf f.path, alias_path
f.build = Tab.new(source: { "path" => alias_path })
@@ -168,6 +172,8 @@ describe Formula do
expect(f.full_installed_alias_name).to eq(full_alias_name)
expect(f.installed_specified_name).to eq(alias_name)
expect(f.full_installed_specified_name).to eq(full_alias_name)
+
+ FileUtils.rm_rf HOMEBREW_LIBRARY/"Taps/user"
end
specify "#prefix" do
@@ -402,6 +408,8 @@ describe Formula do
url "foo-1.0"
end
f.build = Tab.new(source: { "path" => source_path.to_s })
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf f.path, source_path
expect(f.alias_path).to eq(alias_path)
expect(f.installed_alias_path).to eq(source_path.to_s)
@@ -443,6 +451,9 @@ describe Formula do
allow(described_class).to receive(:installed).and_return(formulae)
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf formula_with_alias.path, alias_path
+
expect(described_class.installed_with_alias_path(alias_path))
.to eq([formula_with_alias])
end
@@ -940,6 +951,9 @@ describe Formula do
tab.source["path"] = alias_path
stub_formula_loader(f, alias_path)
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf f.path, alias_path
+
expect(f.current_installed_alias_target).to eq(f)
expect(f.latest_formula).to eq(f)
expect(f).not_to have_changed_installed_alias_target
@@ -952,6 +966,9 @@ describe Formula do
tab.source["path"] = alias_path
stub_formula_loader(new_formula, alias_path)
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf new_formula.path, alias_path
+
expect(f.current_installed_alias_target).to eq(new_formula)
expect(f.latest_formula).to eq(new_formula)
expect(f).to have_changed_installed_alias_target
@@ -964,6 +981,9 @@ describe Formula do
tab.source["path"] = alias_path
stub_formula_loader(new_formula, alias_path)
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf new_formula.path, alias_path
+
expect(new_formula.current_installed_alias_target).to eq(new_formula)
expect(new_formula.latest_formula).to eq(new_formula)
expect(new_formula).not_to have_changed_installed_alias_target
@@ -1050,6 +1070,10 @@ describe Formula do
f.follow_installed_alias = true
f.build = setup_tab_for_prefix(same_prefix, path: alias_path)
stub_formula_loader(new_formula, alias_path)
+
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf new_formula.path, alias_path
+
expect(f.outdated_kegs).not_to be_empty
end
@@ -1088,6 +1112,10 @@ describe Formula do
tab = setup_tab_for_prefix(old_alias_target_prefix, path: alias_path)
old_formula.build = tab
allow(described_class).to receive(:installed).and_return([old_formula])
+
+ CoreTap.instance.alias_dir.mkpath
+ FileUtils.ln_sf f.path, alias_path
+
expect(f.outdated_kegs).not_to be_empty
end