Removed info_spec integration test and replaced with unit test in missing_formula_spec

This commit is contained in:
Zach Auten 2019-03-21 17:18:21 -04:00
parent e9b17b8593
commit 63a0aa92d1
2 changed files with 16 additions and 7 deletions

View File

@ -20,13 +20,6 @@ describe "brew info", :integration_test do
end
end
describe "brew info", :integration_test, :needs_macos do
it "looks for a Cask with the same name if a given Formula does not exist" do
expect { brew "info", "basic-cask" }
.to output(/Found the following cask named "basic-cask" instead:\nbasic-cask: .+\n/).to_stderr
end
end
describe Homebrew do
let(:remote) { "https://github.com/Homebrew/homebrew-core" }

View File

@ -136,4 +136,20 @@ describe Homebrew::MissingFormula do
it { is_expected.to be_nil }
end
end
describe "::cask_reason", :cask do
subject { described_class.cask_reason(formula) }
context "with a missing formula that exists as a cask" do
let(:formula) { "local-caffeine" }
it { is_expected.to match(/Found the following cask named "local-caffeine" instead:\nlocal-caffeine: 1.2.3\n/) }
end
context "with a missing formula that does not share a name with a cask" do
let(:formula) { "missing-formula" }
it { is_expected.to be_nil }
end
end
end