diff --git a/Library/Homebrew/test/cli/named_args_spec.rb b/Library/Homebrew/test/cli/named_args_spec.rb index 826eab0021..6b2e8d2418 100644 --- a/Library/Homebrew/test/cli/named_args_spec.rb +++ b/Library/Homebrew/test/cli/named_args_spec.rb @@ -67,7 +67,7 @@ describe Homebrew::CLI::NamedArgs do end describe "#to_formulae_and_casks" do - it "returns formulae and casks" do + it "returns formulae and casks", :dev_on_linux do stub_formula_loader foo, call_original: true stub_cask_loader baz, call_original: true @@ -121,10 +121,10 @@ describe Homebrew::CLI::NamedArgs do it "raises an error when formula is absent and cask is available on linux", :needs_linux do stub_cask_loader foo_cask - expect { described_class.new("foo").to_formulae_and_casks }.to raise_error(FormulaOrCaskUnavailableError) + expect { described_class.new("foo").to_formulae_and_casks }.to raise_error(FormulaUnavailableError) end - it "returns formula when formula is present and cask is unreadable" do + it "returns formula when formula is present and cask is unreadable", :dev_on_linux do stub_formula_loader foo setup_unredable_cask "foo" @@ -140,7 +140,7 @@ describe Homebrew::CLI::NamedArgs do expect { described_class.new("foo").to_formulae_and_casks }.to output(/Failed to load formula: foo/).to_stderr end - it "raises an error when formula is absent and cask is unreadable" do + it "raises an error when formula is absent and cask is unreadable", :dev_on_linux do setup_unredable_cask "foo" expect { described_class.new("foo").to_formulae_and_casks }.to raise_error(Cask::CaskUnreadableError) diff --git a/Library/Homebrew/test/cli/parser_spec.rb b/Library/Homebrew/test/cli/parser_spec.rb index bfe0ae35c0..408295d91c 100644 --- a/Library/Homebrew/test/cli/parser_spec.rb +++ b/Library/Homebrew/test/cli/parser_spec.rb @@ -570,13 +570,11 @@ describe Homebrew::CLI::Parser do end end - it "throws an error for normal users" do - allow(Homebrew::EnvConfig).to receive(:developer?).and_return(false) + it "throws an error by default" do expect { parser.parse(["--cask"]) }.to raise_error UsageError, /Casks are not supported on Linux/ end - it "only warns developers" do - allow(Homebrew::EnvConfig).to receive(:developer?).and_return(true) + it "only warns developers", :dev_on_linux do expect { parser.parse(["--cask"]) }.not_to raise_error end end diff --git a/Library/Homebrew/test/cmd/--cache_spec.rb b/Library/Homebrew/test/cmd/--cache_spec.rb index 8d9320dacd..ca221f626a 100644 --- a/Library/Homebrew/test/cmd/--cache_spec.rb +++ b/Library/Homebrew/test/cmd/--cache_spec.rb @@ -9,7 +9,6 @@ describe "brew --cache" do it "prints all cache files for a given Formula", :integration_test do expect { brew "--cache", testball } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-}o).to_stdout - .and output(/Treating #{Regexp.escape(testball)} as a formula/).to_stderr .and be_a_success expect { brew "--cache", "--formula", testball } .to output(%r{#{HOMEBREW_CACHE}/downloads/[\da-f]{64}--testball-}o).to_stdout @@ -28,7 +27,7 @@ describe "brew --cache" do .and be_a_success end - it "prints the cache files for a given Formula and Cask", :integration_test, :dev_on_linux do + it "prints the cache files for a given Formula and Cask", :integration_test, :needs_macos do expect { brew "--cache", testball, cask_path("local-caffeine") } .to output( %r{ diff --git a/Library/Homebrew/test/cmd/home_spec.rb b/Library/Homebrew/test/cmd/home_spec.rb index c0cef3f443..3845ac3859 100644 --- a/Library/Homebrew/test/cmd/home_spec.rb +++ b/Library/Homebrew/test/cmd/home_spec.rb @@ -45,7 +45,7 @@ describe "brew home" do .and be_a_success end - it "opens the homepages for a given formula and Cask", :integration_test, :dev_on_linux do + it "opens the homepages for a given formula and Cask", :integration_test, :needs_macos do setup_test_formula "testballhome" expect { brew "home", "testballhome", local_caffeine_path, "HOMEBREW_BROWSER" => "echo" } diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index e307836baa..769f737ce6 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -181,7 +181,7 @@ RSpec.configure do |config| end config.before(:each, :dev_on_linux) do - Allow(Homebrew::EnvConfig).to receive(:developer?).and_return(true) if OS.linux? + allow(Homebrew::EnvConfig).to receive(:developer?).and_return(true) if OS.linux? end config.around do |example|