New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve RSpec/VerifiedDoubles todos #14400
Changes from all commits
6c9d0d5
d4c550b
357807f
585098a
a83623e
bd62afd
d30ba99
ea83253
89c7117
94effcc
72069df
eeac95b
b2ffa09
06d037e
21b4251
a346725
b60eba1
0bfcf91
f365870
f14cd89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,6 @@ | |
|
||
describe Cask::Installer, :cask do | ||
describe "install" do | ||
let(:empty_depends_on_stub) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Appears to be unused (the last reference was removed in |
||
double(formula: [], cask: [], macos: nil, arch: nil) | ||
} | ||
|
||
it "downloads and installs a nice fresh Cask" do | ||
caffeine = Cask::CaskLoader.load(cask_path("local-caffeine")) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,7 @@ | |
let(:compilers) { [:clang, :gnu] } | ||
let(:software_spec) { SoftwareSpec.new } | ||
let(:cc) { :clang } | ||
let(:versions) do | ||
double( | ||
llvm_build_version: Version::NULL, | ||
clang_build_version: Version.create("600"), | ||
) | ||
end | ||
let(:versions) { class_double(DevelopmentTools, clang_build_version: Version.create("600")) } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is the correct |
||
|
||
before do | ||
allow(versions).to receive(:gcc_version) do |name| | ||
|
@@ -46,28 +41,32 @@ | |
|
||
it "returns gcc-6 if gcc formula offers gcc-6 on mac", :needs_macos do | ||
software_spec.fails_with(:clang) | ||
allow(Formulary).to receive(:factory).with("gcc").and_return(double(version: Version.new("6.0"))) | ||
allow(Formulary).to receive(:factory).with("gcc") | ||
.and_return(instance_double(Formula, version: Version.new("6.0"))) | ||
expect(selector.compiler).to eq("gcc-6") | ||
end | ||
|
||
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@11").and_return(double(version: Version.new("5.0"))) | ||
allow(Formulary).to receive(:factory).with("gcc@11") | ||
.and_return(instance_double(Formula, 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@11").and_return(double(version: Version.new("5.0"))) | ||
allow(Formulary).to receive(:factory).with("gcc@11") | ||
.and_return(instance_double(Formula, 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@11").and_return(double(version: Version.new("5.0"))) | ||
allow(Formulary).to receive(:factory).with("gcc@11") | ||
.and_return(instance_double(Formula, version: Version.new("5.0"))) | ||
expect(selector.compiler).to eq("gcc-7") | ||
end | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit tangential, but moving the
attr
here reduces duplication, allows us to remove the matching.rbi
file, and write better tests.