From 63a0aa92d1121f5a5288fd645a0a5838f007a991 Mon Sep 17 00:00:00 2001 From: Zach Auten Date: Thu, 21 Mar 2019 17:18:21 -0400 Subject: [PATCH] Removed info_spec integration test and replaced with unit test in missing_formula_spec --- Library/Homebrew/test/cmd/info_spec.rb | 7 ------- Library/Homebrew/test/missing_formula_spec.rb | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index 1f43aff8cb..b318576e63 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -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" } diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 0abec2aaed..1600e01e96 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -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