From d331c47de074b416b2e9d5ec340f7af71cc6a6d9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 8 Apr 2018 16:07:21 -0700 Subject: [PATCH] diagnostic: remove check_user_curlrc check. --- Library/Homebrew/diagnostic.rb | 15 --------------- Library/Homebrew/test/diagnostic_spec.rb | 9 --------- Library/Homebrew/test/utils/curl_spec.rb | 7 ++++++- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 18808033f5..736f35ff19 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -480,21 +480,6 @@ module Homebrew EOS end - def check_user_curlrc - curlrc_found = %w[CURL_HOME HOME].any? do |var| - ENV[var] && File.exist?("#{ENV[var]}/.curlrc") - end - return unless curlrc_found - - <<~EOS - You have a curlrc file - If you have trouble downloading packages with Homebrew, then maybe this - is the problem? If the following command doesn't work, then try removing - your curlrc: - curl #{Formatter.url("https://github.com")} - EOS - end - def check_for_gettext find_relative_paths("lib/libgettextlib.dylib", "lib/libintl.dylib", diff --git a/Library/Homebrew/test/diagnostic_spec.rb b/Library/Homebrew/test/diagnostic_spec.rb index 8f82e71b1f..52e7d3a392 100644 --- a/Library/Homebrew/test/diagnostic_spec.rb +++ b/Library/Homebrew/test/diagnostic_spec.rb @@ -131,15 +131,6 @@ describe Homebrew::Diagnostic::Checks do end end - specify "#check_user_curlrc" do - mktmpdir do |path| - FileUtils.touch "#{path}/.curlrc" - ENV["CURL_HOME"] = path - - expect(subject.check_user_curlrc).to match("You have a curlrc file") - end - end - specify "#check_for_config_scripts" do mktmpdir do |path| file = "#{path}/foo-config" diff --git a/Library/Homebrew/test/utils/curl_spec.rb b/Library/Homebrew/test/utils/curl_spec.rb index 65ad173ab9..7e3cc18f7a 100644 --- a/Library/Homebrew/test/utils/curl_spec.rb +++ b/Library/Homebrew/test/utils/curl_spec.rb @@ -2,9 +2,14 @@ require "utils/curl" describe "curl" do describe "curl_args" do - it "returns -q as the first argument" do + it "returns -q as the first argument when HOMEBREW_CURLRC is set" do + ENV["HOMEBREW_CURLRC"] = "1" # -q must be the first argument according to "man curl" expect(curl_args("foo")[1]).to eq("-q") end + + it "doesn't return -q as the first argument when HOMEBREW_CURLRC is not set" do + expect(curl_args("foo")[1]).to_not eq("-q") + end end end