Skip to content

Commit

Permalink
test: Update tests that mock gcc@5
Browse files Browse the repository at this point in the history
  • Loading branch information
sjackman committed Aug 31, 2022
1 parent 4ce544b commit 0923271
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Library/Homebrew/test/compiler_selector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@

it "returns gcc-5 if gcc formula offers gcc-5 on linux", :needs_linux do
software_spec.fails_with(:clang)
allow(Formulary).to receive(:factory).with("gcc@5").and_return(double(version: Version.new("5.0")))
allow(Formulary).to receive(:factory).with("gcc@11").and_return(double(version: Version.new("5.0")))
expect(selector.compiler).to eq("gcc-5")
end

it "returns gcc-6 if gcc formula offers gcc-5 and fails with gcc-5 and gcc-7 on linux", :needs_linux do
software_spec.fails_with(:clang)
software_spec.fails_with(gcc: "5")
software_spec.fails_with(gcc: "7")
allow(Formulary).to receive(:factory).with("gcc@5").and_return(double(version: Version.new("5.0")))
allow(Formulary).to receive(:factory).with("gcc@11").and_return(double(version: Version.new("5.0")))
expect(selector.compiler).to eq("gcc-6")
end

it "returns gcc-7 if gcc formula offers gcc-5 and fails with gcc <= 6 on linux", :needs_linux do
software_spec.fails_with(:clang)
software_spec.fails_with(:gcc) { version "6" }
allow(Formulary).to receive(:factory).with("gcc@5").and_return(double(version: Version.new("5.0")))
allow(Formulary).to receive(:factory).with("gcc@11").and_return(double(version: Version.new("5.0")))
expect(selector.compiler).to eq("gcc-7")
end

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/formula_installer_bottle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def temporarily_install_bottle(formula)

stub_formula_loader formula
stub_formula_loader formula("gcc") { url "gcc-1.0" }
stub_formula_loader formula("gcc@5") { url "gcc-5.0" }
stub_formula_loader formula("gcc@11") { url "gcc-11.0" }

fi = FormulaInstaller.new(formula)
fi.fetch
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/test/formulary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class Wrong#{described_class.class_s(formula_name)} < Formula
before do
allow(described_class).to receive(:loader_for).and_call_original
stub_formula_loader formula("gcc") { url "gcc-1.0" }
stub_formula_loader formula("gcc@5") { url "gcc-5.0" }
stub_formula_loader formula("gcc@11") { url "gcc-11.0" }
end

let(:installed_formula) { described_class.factory(formula_path) }
Expand Down

0 comments on commit 0923271

Please sign in to comment.