diff options
| author | Mike McQuaid | 2017-04-22 13:25:38 +0100 |
|---|---|---|
| committer | GitHub | 2017-04-22 13:25:38 +0100 |
| commit | 206d6de845c9041bbbd4d955e56befb338295e96 (patch) | |
| tree | 7bb013e4ceab38c5ebda73d9e8a23df035e97abf /Library | |
| parent | 10d70aa93a25b80efe3581cf82e789f05716517d (diff) | |
| parent | a6df701fad516a1da54ea245fb47826d47dc03b5 (diff) | |
| download | brew-206d6de845c9041bbbd4d955e56befb338295e96.tar.bz2 | |
Merge pull request #2521 from MikeMcQuaid/tests-reduce-noise
tests: reduce some noise.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/dev-cmd/tests.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/style_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/uninstall_spec.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/cmd/bundle_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/dev-cmd/pull_spec.rb | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/missing_formula_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/spec_helper.rb | 4 |
7 files changed, 17 insertions, 8 deletions
diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index 6862c9a79..72d6143fc 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -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" diff --git a/Library/Homebrew/test/cask/cli/style_spec.rb b/Library/Homebrew/test/cask/cli/style_spec.rb index ca17c5e46..d41636beb 100644 --- a/Library/Homebrew/test/cask/cli/style_spec.rb +++ b/Library/Homebrew/test/cask/cli/style_spec.rb @@ -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 diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index fb196ee72..c03f64c8f 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -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 diff --git a/Library/Homebrew/test/cmd/bundle_spec.rb b/Library/Homebrew/test/cmd/bundle_spec.rb index 13f13485c..286ddba97 100644 --- a/Library/Homebrew/test/cmd/bundle_spec.rb +++ b/Library/Homebrew/test/cmd/bundle_spec.rb @@ -1,6 +1,6 @@ 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 diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb index 3c0108df2..2ebe144bb 100644 --- a/Library/Homebrew/test/dev-cmd/pull_spec.rb +++ b/Library/Homebrew/test/dev-cmd/pull_spec.rb @@ -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" diff --git a/Library/Homebrew/test/missing_formula_spec.rb b/Library/Homebrew/test/missing_formula_spec.rb index 215cf17f7..69bb3e70d 100644 --- a/Library/Homebrew/test/missing_formula_spec.rb +++ b/Library/Homebrew/test/missing_formula_spec.rb @@ -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 diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 2f6274fd1..005c6d2fb 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -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) |
