Skip to content
Snippets Groups Projects
Commit 206d6de8 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #2521 from MikeMcQuaid/tests-reduce-noise

tests: reduce some noise.
parents 10d70aa9 a6df701f
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,12 @@ module Homebrew
ENV["HOMEBREW_DEVELOPER"] = "1"
ENV["HOMEBREW_NO_COMPAT"] = "1" if ARGV.include? "--no-compat"
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if ARGV.include? "--generic"
ENV["HOMEBREW_NO_GITHUB_API"] = "1" unless ARGV.include? "--online"
if ARGV.include? "--online"
ENV["HOMEBREW_TEST_ONLINE"] = "1"
else
ENV["HOMEBREW_NO_GITHUB_API"] = "1"
end
if ARGV.include? "--official-cmd-taps"
ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"] = "1"
......
......@@ -81,7 +81,7 @@ describe Hbc::CLI::Style, :cask do
end
context "version" do
it "matches `HOMEBREW_RUBOCOP_VERSION`" do
it "matches `HOMEBREW_RUBOCOP_VERSION`", :needs_network do
stdout, status = Open3.capture2("gem", "dependency", "rubocop-cask", "--version", HOMEBREW_RUBOCOP_CASK_VERSION, "--pipe", "--remote")
expect(status).to be_a_success
......
......@@ -13,7 +13,9 @@ describe Hbc::CLI::Uninstall, :cask do
it "tries anyway on a non-present Cask when --force is given" do
expect {
Hbc::CLI::Uninstall.run("local-caffeine", "--force")
shutup do
Hbc::CLI::Uninstall.run("local-caffeine", "--force")
end
}.not_to raise_error
end
......
describe "brew bundle", :integration_test, :needs_test_cmd_taps do
describe "check" do
it "checks if a Brewfile's dependencies are satisfied" do
it "checks if a Brewfile's dependencies are satisfied", :needs_network do
setup_remote_tap "homebrew/bundle"
HOMEBREW_REPOSITORY.cd do
......
......@@ -6,9 +6,7 @@ describe "brew pull", :integration_test do
.and be_a_failure
end
it "fetches a patch from a GitHub commit or pull request and applies it" do
skip "Requires network connection." if ENV["HOMEBREW_NO_GITHUB_API"]
it "fetches a patch from a GitHub commit or pull request and applies it", :needs_network do
CoreTap.instance.path.cd do
shutup do
system "git", "init"
......
......@@ -139,7 +139,7 @@ describe Homebrew::MissingFormula do
end
context "::deleted_reason" do
subject { described_class.deleted_reason(formula) }
subject { described_class.deleted_reason(formula, silent: true) }
before do
Tap.clear_cache
......
......@@ -61,6 +61,10 @@ RSpec.configure do |config|
skip "Python not installed." unless which("python")
end
config.before(:each, :needs_network) do
skip "Requires network connection." unless ENV["HOMEBREW_TEST_ONLINE"]
end
config.around(:each) do |example|
begin
TEST_DIRECTORIES.each(&:mkpath)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment