aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/cmd/irb.rb1
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb139
-rw-r--r--Library/Homebrew/test/ENV_test.rb27
-rw-r--r--Library/Homebrew/test/audit_test.rb5
-rw-r--r--Library/Homebrew/test/bottle_test.rb21
-rw-r--r--Library/Homebrew/test/bundle_test.rb22
-rw-r--r--Library/Homebrew/test/cache_formula_test.rb8
-rw-r--r--Library/Homebrew/test/cache_test.rb8
-rw-r--r--Library/Homebrew/test/cask_test.rb10
-rw-r--r--Library/Homebrew/test/cat_test.rb8
-rw-r--r--Library/Homebrew/test/cellar_formula_test.rb8
-rw-r--r--Library/Homebrew/test/cellar_test.rb8
-rw-r--r--Library/Homebrew/test/cleanup_test.rb7
-rw-r--r--Library/Homebrew/test/cmd/--cache_spec.rb15
-rw-r--r--Library/Homebrew/test/cmd/--cellar_spec.rb15
-rw-r--r--Library/Homebrew/test/cmd/--env_spec.rb44
-rw-r--r--Library/Homebrew/test/cmd/--prefix_spec.rb15
-rw-r--r--Library/Homebrew/test/cmd/--repository_spec.rb15
-rw-r--r--Library/Homebrew/test/cmd/--version_spec.rb8
-rw-r--r--Library/Homebrew/test/cmd/bundle_spec.rb24
-rw-r--r--Library/Homebrew/test/cmd/cask_spec.rb8
-rw-r--r--Library/Homebrew/test/cmd/cat_spec.rb11
-rw-r--r--Library/Homebrew/test/cmd/cleanup_spec.rb12
-rw-r--r--Library/Homebrew/test/cmd/command_spec.rb13
-rw-r--r--Library/Homebrew/test/cmd/commands_spec.rb7
-rw-r--r--Library/Homebrew/test/cmd/config_spec.rb8
-rw-r--r--Library/Homebrew/test/cmd/custom-external-command_spec.rb21
-rw-r--r--Library/Homebrew/test/cmd/doctor_spec.rb6
-rw-r--r--Library/Homebrew/test/cmd/fetch_spec.rb13
-rw-r--r--Library/Homebrew/test/cmd/help_spec.rb47
-rw-r--r--Library/Homebrew/test/cmd/home_spec.rb17
-rw-r--r--Library/Homebrew/test/cmd/irb_spec.rb24
-rw-r--r--Library/Homebrew/test/cmd/leaves_spec.rb23
-rw-r--r--Library/Homebrew/test/cmd/link_spec.rb56
-rw-r--r--Library/Homebrew/test/cmd/linkapps_spec.rb24
-rw-r--r--Library/Homebrew/test/cmd/list_spec.rb14
-rw-r--r--Library/Homebrew/test/cmd/log_spec.rb41
-rw-r--r--Library/Homebrew/test/cmd/migrate_spec.rb46
-rw-r--r--Library/Homebrew/test/cmd/missing_spec.rb41
-rw-r--r--Library/Homebrew/test/cmd/options_spec.rb12
-rw-r--r--Library/Homebrew/test/cmd/outdated_spec.rb11
-rw-r--r--Library/Homebrew/test/cmd/pin_spec.rb13
-rw-r--r--Library/Homebrew/test/cmd/prune_spec.rb28
-rw-r--r--Library/Homebrew/test/cmd/readall_spec.rb20
-rw-r--r--Library/Homebrew/test/cmd/reinstall_spec.rb47
-rw-r--r--Library/Homebrew/test/cmd/search_spec.rb57
-rw-r--r--Library/Homebrew/test/cmd/services_spec.rb10
-rw-r--r--Library/Homebrew/test/cmd/sh_spec.rb8
-rw-r--r--Library/Homebrew/test/cmd/tap-new_spec.rb10
-rw-r--r--Library/Homebrew/test/cmd/uninstall_spec.rb12
-rw-r--r--Library/Homebrew/test/cmd/unlink_spec.rb14
-rw-r--r--Library/Homebrew/test/cmd/unlinkapps_spec.rb24
-rw-r--r--Library/Homebrew/test/cmd/unpack_spec.rb16
-rw-r--r--Library/Homebrew/test/cmd/unpin_spec.rb14
-rw-r--r--Library/Homebrew/test/cmd/upgrade_spec.rb12
-rw-r--r--Library/Homebrew/test/cmd/uses_spec.rb25
-rw-r--r--Library/Homebrew/test/command_test.rb11
-rw-r--r--Library/Homebrew/test/commands_test.rb7
-rw-r--r--Library/Homebrew/test/config_test.rb8
-rw-r--r--Library/Homebrew/test/create_test.rb12
-rw-r--r--Library/Homebrew/test/custom_command_test.rb18
-rw-r--r--Library/Homebrew/test/dev-cmd/bottle_spec.rb30
-rw-r--r--Library/Homebrew/test/dev-cmd/create_spec.rb13
-rw-r--r--Library/Homebrew/test/dev-cmd/edit_spec.rb16
-rw-r--r--Library/Homebrew/test/dev-cmd/formula_spec.rb10
-rw-r--r--Library/Homebrew/test/dev-cmd/pull_spec.rb60
-rw-r--r--Library/Homebrew/test/dev-cmd/tap_spec.rb75
-rw-r--r--Library/Homebrew/test/dev-cmd/test_spec.rb56
-rw-r--r--Library/Homebrew/test/doctor_test.rb8
-rw-r--r--Library/Homebrew/test/edit_test.rb11
-rw-r--r--Library/Homebrew/test/fetch_test.rb11
-rw-r--r--Library/Homebrew/test/formula_cmd_test.rb8
-rw-r--r--Library/Homebrew/test/help_test.rb21
-rw-r--r--Library/Homebrew/test/home_test.rb12
-rw-r--r--Library/Homebrew/test/irb_test.rb19
-rw-r--r--Library/Homebrew/test/leaves_test.rb15
-rw-r--r--Library/Homebrew/test/link_test.rb23
-rw-r--r--Library/Homebrew/test/linkapps_test.rb15
-rw-r--r--Library/Homebrew/test/list_test.rb13
-rw-r--r--Library/Homebrew/test/log_formula_test.rb27
-rw-r--r--Library/Homebrew/test/log_test.rb13
-rw-r--r--Library/Homebrew/test/migrate_test.rb18
-rw-r--r--Library/Homebrew/test/missing_test.rb34
-rw-r--r--Library/Homebrew/test/options_test.rb12
-rw-r--r--Library/Homebrew/test/outdated_test.rb10
-rw-r--r--Library/Homebrew/test/pin_unpin_test.rb18
-rw-r--r--Library/Homebrew/test/prefix_formula_test.rb8
-rw-r--r--Library/Homebrew/test/prefix_test.rb8
-rw-r--r--Library/Homebrew/test/prune_test.rb21
-rw-r--r--Library/Homebrew/test/pull_offline_test.rb10
-rw-r--r--Library/Homebrew/test/pull_test.rb27
-rw-r--r--Library/Homebrew/test/readall_test.rb12
-rw-r--r--Library/Homebrew/test/reinstall_pinned_test.rb15
-rw-r--r--Library/Homebrew/test/reinstall_test.rb24
-rw-r--r--Library/Homebrew/test/repository_test.rb10
-rw-r--r--Library/Homebrew/test/search_test.rb30
-rw-r--r--Library/Homebrew/test/services_test.rb11
-rw-r--r--Library/Homebrew/test/sh_test.rb8
-rw-r--r--Library/Homebrew/test/tap_new_test.rb9
-rw-r--r--Library/Homebrew/test/tap_test.rb30
-rw-r--r--Library/Homebrew/test/test_formula_test.rb30
-rw-r--r--Library/Homebrew/test/uninstall_test.rb7
-rw-r--r--Library/Homebrew/test/unlink_test.rb10
-rw-r--r--Library/Homebrew/test/unlinkapps_test.rb19
-rw-r--r--Library/Homebrew/test/unpack_test.rb13
-rw-r--r--Library/Homebrew/test/upgrade_test.rb12
-rw-r--r--Library/Homebrew/test/uses_test.rb16
-rw-r--r--Library/Homebrew/test/version_test.rb8
-rw-r--r--Library/Homebrew/utils.rb1
-rw-r--r--Library/Homebrew/utils/git.rb5
-rw-r--r--Library/Homebrew/utils/svn.rb11
-rw-r--r--README.md4
-rw-r--r--docs/Acceptable-Formulae.md4
-rw-r--r--docs/Brew-Test-Bot-For-Core-Contributors.md6
-rw-r--r--docs/Brew-Test-Bot.md6
-rw-r--r--docs/Common-Issues.md3
-rw-r--r--docs/External-Commands.md6
-rw-r--r--docs/FAQ.md5
-rw-r--r--docs/Formula-Cookbook.md6
-rw-r--r--docs/Gems,-Eggs-and-Perl-Modules.md2
-rw-r--r--docs/Homebrew-and-Python.md2
-rw-r--r--docs/How-To-Open-a-Homebrew-Pull-Request.md4
-rw-r--r--docs/Interesting-Taps-&-Forks.md2
-rw-r--r--docs/Node-for-Formula-Authors.md26
-rw-r--r--docs/Prose-Style-Guidelines.md4
-rw-r--r--docs/Python-for-Formula-Authors.md12
-rw-r--r--docs/Querying-Brew.md8
-rw-r--r--docs/Tips-N'-Tricks.md2
-rw-r--r--docs/Versions.md2
-rw-r--r--docs/brew-tap.md2
130 files changed, 1318 insertions, 920 deletions
diff --git a/Library/Homebrew/cmd/irb.rb b/Library/Homebrew/cmd/irb.rb
index d162e3f4a..5561845e7 100644
--- a/Library/Homebrew/cmd/irb.rb
+++ b/Library/Homebrew/cmd/irb.rb
@@ -12,6 +12,7 @@ class Symbol
Formulary.factory(to_s, *args)
end
end
+
class String
def f(*args)
Formulary.factory(self, *args)
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 9ffef0f99..e49f65dd2 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -174,30 +174,64 @@ class FormulaAuditor
@specs = %w[stable devel head].map { |s| formula.send(s) }.compact
end
- def url_status_code(url, range: false)
- # The system Curl is too old and unreliable with HTTPS homepages on
- # Yosemite and below.
- return "200" unless DevelopmentTools.curl_handles_most_https_homepages?
+ def self.check_http_content(url, user_agents: [:default])
+ return unless url.start_with? "http"
- extra_args = [
- "--connect-timeout", "15",
- "--output", "/dev/null",
- "--write-out", "%{http_code}"
- ]
- extra_args << "--range" << "0-0" if range
- extra_args << url
-
- status_code = nil
- [:browser, :default].each do |user_agent|
- args = curl_args(
- extra_args: extra_args,
- show_output: true,
- user_agent: user_agent,
- )
- status_code = Open3.popen3(*args) { |_, stdout, _, _| stdout.read }
- break if status_code.start_with? "20"
- end
- status_code
+ details = nil
+ user_agent = nil
+ user_agents.each do |ua|
+ details = http_content_headers_and_checksum(url, user_agent: ua)
+ user_agent = ua
+ break if details[:status].to_s.start_with?("2")
+ end
+
+ return "The URL #{url} is not reachable" unless details[:status]
+ unless details[:status].start_with? "2"
+ return "The URL #{url} is not reachable (HTTP status code #{details[:status]})"
+ end
+
+ return unless url.start_with? "http:"
+
+ secure_url = url.sub "http", "https"
+ secure_details =
+ http_content_headers_and_checksum(secure_url, user_agent: user_agent)
+
+ if !details[:status].to_s.start_with?("2") ||
+ !secure_details[:status].to_s.start_with?("2")
+ return
+ end
+
+ etag_match = details[:etag] &&
+ details[:etag] == secure_details[:etag]
+ content_length_match =
+ details[:content_length] &&
+ details[:content_length] == secure_details[:content_length]
+ file_match = details[:file_hash] == secure_details[:file_hash]
+
+ return if !etag_match && !content_length_match && !file_match
+ "The URL #{url} could use HTTPS rather than HTTP"
+ end
+
+ def self.http_content_headers_and_checksum(url, user_agent: :default)
+ args = curl_args(
+ extra_args: ["--connect-timeout", "15", "--include", url],
+ show_output: true,
+ user_agent: user_agent,
+ )
+ output = Open3.popen3(*args) { |_, stdout, _, _| stdout.read }
+
+ status_code = :unknown
+ while status_code == :unknown || status_code.to_s.start_with?("3")
+ headers, _, output = output.partition("\r\n\r\n")
+ status_code = headers[%r{HTTP\/.* (\d+)}, 1]
+ end
+
+ {
+ status: status_code,
+ etag: headers[%r{ETag: ([wW]\/)?"(([^"]|\\")*)"}, 2],
+ content_length: headers[/Content-Length: (\d+)/, 1],
+ file_hash: Digest::SHA256.digest(output),
+ }
end
def audit_style
@@ -619,9 +653,13 @@ class FormulaAuditor
return unless @online
- status_code = url_status_code(homepage)
- return if status_code.start_with? "20"
- problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
+ # The system Curl is too old and unreliable with HTTPS homepages on
+ # Yosemite and below.
+ return unless DevelopmentTools.curl_handles_most_https_homepages?
+ if http_content_problem = FormulaAuditor.check_http_content(homepage,
+ user_agents: [:browser, :default])
+ problem http_content_problem
+ end
end
def audit_bottle_spec
@@ -671,11 +709,11 @@ class FormulaAuditor
%w[Stable Devel HEAD].each do |name|
next unless spec = formula.send(name.downcase)
- ra = ResourceAuditor.new(spec, online: @online).audit
+ ra = ResourceAuditor.new(spec, online: @online, strict: @strict).audit
problems.concat ra.problems.map { |problem| "#{name}: #{problem}" }
spec.resources.each_value do |resource|
- ra = ResourceAuditor.new(resource, online: @online).audit
+ ra = ResourceAuditor.new(resource, online: @online, strict: @strict).audit
problems.concat ra.problems.map { |problem|
"#{name} resource #{resource.name.inspect}: #{problem}"
}
@@ -1231,6 +1269,7 @@ class ResourceAuditor
@using = resource.using
@specs = resource.specs
@online = options[:online]
+ @strict = options[:strict]
@problems = []
end
@@ -1490,38 +1529,26 @@ class ResourceAuditor
return unless @online
urls.each do |url|
- check_insecure_mirror(url) if url.start_with? "http:"
- end
- end
-
- def check_insecure_mirror(url)
- details = get_content_details(url)
- secure_url = url.sub "http", "https"
- secure_details = get_content_details(secure_url)
-
- return if details[:status].nil? || secure_details[:status].nil? || !details[:status].start_with?("2") || !secure_details[:status].start_with?("2")
-
- etag_match = details[:etag] && details[:etag] == secure_details[:etag]
- content_length_match = details[:content_length] && details[:content_length] == secure_details[:content_length]
- file_match = details[:file_hash] == secure_details[:file_hash]
+ next if !@strict && mirrors.include?(url)
- return if !etag_match && !content_length_match && !file_match
- problem "The URL #{url} could use HTTPS rather than HTTP"
+ strategy = DownloadStrategyDetector.detect(url, using)
+ if strategy <= CurlDownloadStrategy && !url.start_with?("file")
+ if http_content_problem = FormulaAuditor.check_http_content(url)
+ problem http_content_problem
+ end
+ elsif strategy <= GitDownloadStrategy
+ unless Utils.git_remote_exists url
+ problem "The URL #{url} is not a valid git URL"
+ end
+ elsif strategy <= SubversionDownloadStrategy
+ unless Utils.svn_remote_exists url
+ problem "The URL #{url} is not a valid svn URL"
+ end
+ end
+ end
end
def problem(text)
@problems << text
end
-
- def get_content_details(url)
- out = {}
- output, = curl_output "--connect-timeout", "15", "--include", url
- split = output.partition("\r\n\r\n")
- headers = split.first
- out[:status] = headers[%r{HTTP\/.* (\d+)}, 1]
- out[:etag] = headers[%r{ETag: ([wW]\/)?"(([^"]|\\")*)"}, 2]
- out[:content_length] = headers[/Content-Length: (\d+)/, 1]
- out[:file_hash] = Digest::SHA256.digest split.last
- out
- end
end
diff --git a/Library/Homebrew/test/ENV_test.rb b/Library/Homebrew/test/ENV_test.rb
index cbfd01e25..66b59d8a4 100644
--- a/Library/Homebrew/test/ENV_test.rb
+++ b/Library/Homebrew/test/ENV_test.rb
@@ -2,33 +2,6 @@ require "testing_env"
require "extend/ENV"
require "testing_env"
-class IntegrationCommandTestEnv < IntegrationCommandTestCase
- def test_env
- assert_match(/CMAKE_PREFIX_PATH="#{Regexp.escape(HOMEBREW_PREFIX)}[:"]/,
- cmd("--env"))
- end
-
- def test_env_fish
- assert_match(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/,
- cmd("--env", "--shell=fish"))
- end
-
- def test_env_csh
- assert_match(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/,
- cmd("--env", "--shell=tcsh"))
- end
-
- def test_env_bash
- assert_match(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/,
- cmd("--env", "--shell=bash"))
- end
-
- def test_env_plain
- assert_match(/CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}/,
- cmd("--env", "--plain"))
- end
-end
-
module SharedEnvTests
def setup
super
diff --git a/Library/Homebrew/test/audit_test.rb b/Library/Homebrew/test/audit_test.rb
index 9165edef1..1d93c31e0 100644
--- a/Library/Homebrew/test/audit_test.rb
+++ b/Library/Homebrew/test/audit_test.rb
@@ -419,9 +419,8 @@ class FormulaAuditorTests < Homebrew::TestCase
EOS
fa.audit_homepage
- assert_equal ["The homepage should start with http or https " \
- "(URL is #{fa.formula.homepage}).", "The homepage #{fa.formula.homepage} is not reachable " \
- "(HTTP status code 000)"], fa.problems
+ assert_equal ["The homepage should start with http or https (URL is #{fa.formula.homepage})."],
+ fa.problems
formula_homepages = {
"bar" => "http://www.freedesktop.org/wiki/bar",
diff --git a/Library/Homebrew/test/bottle_test.rb b/Library/Homebrew/test/bottle_test.rb
deleted file mode 100644
index 7981ccf79..000000000
--- a/Library/Homebrew/test/bottle_test.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestBottle < IntegrationCommandTestCase
- def test_bottle
- cmd("install", "--build-bottle", testball)
- assert_match "Formula not from core or any taps",
- cmd_fail("bottle", "--no-rebuild", testball)
-
- setup_test_formula "testball"
-
- # `brew bottle` should not fail with dead symlink
- # https://github.com/Homebrew/legacy-homebrew/issues/49007
- (HOMEBREW_CELLAR/"testball/0.1").cd do
- FileUtils.ln_s "not-exist", "symlink"
- end
- assert_match(/testball-0\.1.*\.bottle\.tar\.gz/,
- cmd("bottle", "--no-rebuild", "testball"))
- ensure
- FileUtils.rm_f Dir["testball-0.1*.bottle.tar.gz"]
- end
-end
diff --git a/Library/Homebrew/test/bundle_test.rb b/Library/Homebrew/test/bundle_test.rb
deleted file mode 100644
index ae47977d8..000000000
--- a/Library/Homebrew/test/bundle_test.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestBundle < IntegrationCommandTestCase
- def test_bundle
- needs_test_cmd_taps
- setup_remote_tap("homebrew/bundle")
- HOMEBREW_REPOSITORY.cd do
- shutup do
- system "git", "init"
- system "git", "commit", "--allow-empty", "-m", "This is a test commit"
- end
- end
-
- mktmpdir do |path|
- FileUtils.touch "#{path}/Brewfile"
- Dir.chdir path do
- assert_equal "The Brewfile's dependencies are satisfied.",
- cmd("bundle", "check")
- end
- end
- end
-end
diff --git a/Library/Homebrew/test/cache_formula_test.rb b/Library/Homebrew/test/cache_formula_test.rb
deleted file mode 100644
index 6dcb6a745..000000000
--- a/Library/Homebrew/test/cache_formula_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase
- def test_cache_formula
- assert_match %r{#{HOMEBREW_CACHE}/testball-},
- cmd("--cache", testball)
- end
-end
diff --git a/Library/Homebrew/test/cache_test.rb b/Library/Homebrew/test/cache_test.rb
deleted file mode 100644
index 3a9e6b011..000000000
--- a/Library/Homebrew/test/cache_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCache < IntegrationCommandTestCase
- def test_cache
- assert_equal HOMEBREW_CACHE.to_s,
- cmd("--cache")
- end
-end
diff --git a/Library/Homebrew/test/cask_test.rb b/Library/Homebrew/test/cask_test.rb
deleted file mode 100644
index d5b81facb..000000000
--- a/Library/Homebrew/test/cask_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCask < IntegrationCommandTestCase
- def test_cask
- needs_test_cmd_taps
- needs_macos
- setup_remote_tap("caskroom/cask")
- cmd("cask", "list", "--caskroom=#{HOMEBREW_PREFIX}/Caskroom")
- end
-end
diff --git a/Library/Homebrew/test/cat_test.rb b/Library/Homebrew/test/cat_test.rb
deleted file mode 100644
index bb37b5fde..000000000
--- a/Library/Homebrew/test/cat_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCat < IntegrationCommandTestCase
- def test_cat
- formula_file = setup_test_formula "testball"
- assert_equal formula_file.read.chomp, cmd("cat", "testball")
- end
-end
diff --git a/Library/Homebrew/test/cellar_formula_test.rb b/Library/Homebrew/test/cellar_formula_test.rb
deleted file mode 100644
index 38a934a7b..000000000
--- a/Library/Homebrew/test/cellar_formula_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase
- def test_cellar_formula
- assert_match "#{HOMEBREW_CELLAR}/testball",
- cmd("--cellar", testball)
- end
-end
diff --git a/Library/Homebrew/test/cellar_test.rb b/Library/Homebrew/test/cellar_test.rb
deleted file mode 100644
index 74d5389f8..000000000
--- a/Library/Homebrew/test/cellar_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCellar < IntegrationCommandTestCase
- def test_cellar
- assert_equal HOMEBREW_CELLAR.to_s,
- cmd("--cellar")
- end
-end
diff --git a/Library/Homebrew/test/cleanup_test.rb b/Library/Homebrew/test/cleanup_test.rb
index e6fc31dfe..bc7a6713c 100644
--- a/Library/Homebrew/test/cleanup_test.rb
+++ b/Library/Homebrew/test/cleanup_test.rb
@@ -5,13 +5,6 @@ require "fileutils"
require "pathname"
require "testing_env"
-class IntegrationCommandTestCleanup < IntegrationCommandTestCase
- def test_cleanup
- (HOMEBREW_CACHE/"test").write "test"
- assert_match "#{HOMEBREW_CACHE}/test", cmd("cleanup", "--prune=all")
- end
-end
-
class CleanupTests < Homebrew::TestCase
def setup
super
diff --git a/Library/Homebrew/test/cmd/--cache_spec.rb b/Library/Homebrew/test/cmd/--cache_spec.rb
new file mode 100644
index 000000000..fb3c9cee6
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--cache_spec.rb
@@ -0,0 +1,15 @@
+describe "brew --cache", :integration_test do
+ it "print the location of Homebrew's cache when no argument is given" do
+ expect { brew "--cache" }
+ .to output("#{HOMEBREW_CACHE}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "prints all cache files for a given Formula" do
+ expect { brew "--cache", testball }
+ .to output(%r{#{HOMEBREW_CACHE}/testball-}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/--cellar_spec.rb b/Library/Homebrew/test/cmd/--cellar_spec.rb
new file mode 100644
index 000000000..6c8d7dea6
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--cellar_spec.rb
@@ -0,0 +1,15 @@
+describe "brew --cellar", :integration_test do
+ it "print the location of Homebrew's Cellar when no argument is given" do
+ expect { brew "--cellar" }
+ .to output("#{HOMEBREW_CELLAR}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "returns the Cellar subdirectory for a given Formula" do
+ expect { brew "--cellar", testball }
+ .to output(%r{#{HOMEBREW_CELLAR}/testball}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/--env_spec.rb b/Library/Homebrew/test/cmd/--env_spec.rb
new file mode 100644
index 000000000..7dd84132a
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--env_spec.rb
@@ -0,0 +1,44 @@
+describe "brew --env", :integration_test do
+ it "prints the Homebrew build environment variables" do
+ expect { brew "--env" }
+ .to output(/CMAKE_PREFIX_PATH="#{Regexp.escape(HOMEBREW_PREFIX)}[:"]/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ describe "--shell=bash" do
+ it "prints the Homebrew build environment variables in Bash syntax" do
+ expect { brew "--env", "--shell=bash" }
+ .to output(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+
+ describe "--shell=fish" do
+ it "prints the Homebrew build environment variables in Fish syntax" do
+ expect { brew "--env", "--shell=fish" }
+ .to output(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+
+ describe "--shell=tcsh" do
+ it "prints the Homebrew build environment variables in Tcsh syntax" do
+ expect { brew "--env", "--shell=tcsh" }
+ .to output(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+
+ describe "--plain" do
+ it "prints the Homebrew build environment variables without quotes" do
+ expect { brew "--env", "--plain" }
+ .to output(/CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/--prefix_spec.rb b/Library/Homebrew/test/cmd/--prefix_spec.rb
new file mode 100644
index 000000000..80ef73a97
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--prefix_spec.rb
@@ -0,0 +1,15 @@
+describe "brew --prefix", :integration_test do
+ it "prints the Homebrew prefix when no argument is given" do
+ expect { brew "--prefix" }
+ .to output("#{HOMEBREW_PREFIX}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "prints a given Formula's prefix" do
+ expect { brew "--prefix", testball }
+ .to output(%r{#{HOMEBREW_CELLAR}/testball}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/--repository_spec.rb b/Library/Homebrew/test/cmd/--repository_spec.rb
new file mode 100644
index 000000000..d3e531f7b
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--repository_spec.rb
@@ -0,0 +1,15 @@
+describe "brew --repository", :integration_test do
+ it "prints the path of the Homebrew repository" do
+ expect { brew "--repository" }
+ .to output("#{HOMEBREW_REPOSITORY}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "prints the path of a given Tap" do
+ expect { brew "--repository", "foo/bar" }
+ .to output("#{HOMEBREW_LIBRARY}/Taps/foo/homebrew-bar\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/--version_spec.rb b/Library/Homebrew/test/cmd/--version_spec.rb
new file mode 100644
index 000000000..8992629d7
--- /dev/null
+++ b/Library/Homebrew/test/cmd/--version_spec.rb
@@ -0,0 +1,8 @@
+describe "brew --version", :integration_test do
+ it "prints the Homebrew version" do
+ expect { brew "--version" }
+ .to output(/^Homebrew #{Regexp.escape(HOMEBREW_VERSION.to_s)}\n/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/bundle_spec.rb b/Library/Homebrew/test/cmd/bundle_spec.rb
new file mode 100644
index 000000000..755f9ab3d
--- /dev/null
+++ b/Library/Homebrew/test/cmd/bundle_spec.rb
@@ -0,0 +1,24 @@
+describe "brew bundle", :integration_test, :needs_test_cmd_taps do
+ describe "check" do
+ it "checks if a Brewfile's dependencies are satisfied" do
+ setup_remote_tap "homebrew/bundle"
+
+ HOMEBREW_REPOSITORY.cd do
+ shutup do
+ system "git", "init"
+ system "git", "commit", "--allow-empty", "-m", "This is a test commit"
+ end
+ end
+
+ Dir.mktmpdir do |path|
+ FileUtils.touch "#{path}/Brewfile"
+ Dir.chdir path do
+ expect { brew "bundle", "check" }
+ .to output("The Brewfile's dependencies are satisfied.\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/cask_spec.rb b/Library/Homebrew/test/cmd/cask_spec.rb
new file mode 100644
index 000000000..e46843cab
--- /dev/null
+++ b/Library/Homebrew/test/cmd/cask_spec.rb
@@ -0,0 +1,8 @@
+describe "brew cask", :integration_test, :needs_macos, :needs_official_cmd_taps do
+ describe "list" do
+ it "returns a list of installed Casks" do
+ setup_remote_tap("caskroom/cask")
+ expect { brew "cask", "list" }.to be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/cat_spec.rb b/Library/Homebrew/test/cmd/cat_spec.rb
new file mode 100644
index 000000000..8c230abee
--- /dev/null
+++ b/Library/Homebrew/test/cmd/cat_spec.rb
@@ -0,0 +1,11 @@
+describe "brew cat", :integration_test do
+ it "prints the content of a given Formula" do
+ formula_file = setup_test_formula "testball"
+ content = formula_file.read
+
+ expect { brew "cat", "testball" }
+ .to output(content).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/cleanup_spec.rb b/Library/Homebrew/test/cmd/cleanup_spec.rb
new file mode 100644
index 000000000..9e2cf493f
--- /dev/null
+++ b/Library/Homebrew/test/cmd/cleanup_spec.rb
@@ -0,0 +1,12 @@
+describe "brew cleanup", :integration_test do
+ describe "--prune=all" do
+ it "removes all files in Homebrew's cache" do
+ (HOMEBREW_CACHE/"test").write "test"
+
+ expect { brew "cleanup", "--prune=all" }
+ .to output(%r{#{Regexp.escape(HOMEBREW_CACHE)}/test}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/command_spec.rb b/Library/Homebrew/test/cmd/command_spec.rb
new file mode 100644
index 000000000..5d6a67b70
--- /dev/null
+++ b/Library/Homebrew/test/cmd/command_spec.rb
@@ -0,0 +1,13 @@
+describe "brew command", :integration_test do
+ it "returns the file for a given command" do
+ expect { brew "command", "info" }
+ .to output(%r{#{Regexp.escape(HOMEBREW_LIBRARY_PATH)}/cmd/info.rb}).to_stdout
+ .and be_a_success
+ end
+
+ it "fails when the given command is unknown" do
+ expect { brew "command", "does-not-exist" }
+ .to output(/Unknown command/).to_stderr
+ .and be_a_failure
+ end
+end
diff --git a/Library/Homebrew/test/cmd/commands_spec.rb b/Library/Homebrew/test/cmd/commands_spec.rb
new file mode 100644
index 000000000..f42072956
--- /dev/null
+++ b/Library/Homebrew/test/cmd/commands_spec.rb
@@ -0,0 +1,7 @@
+describe "brew commands", :integration_test do
+ it "prints a list of all available commands" do
+ expect { brew "commands" }
+ .to output(/Built-in commands/).to_stdout
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/config_spec.rb b/Library/Homebrew/test/cmd/config_spec.rb
new file mode 100644
index 000000000..7687fcdc7
--- /dev/null
+++ b/Library/Homebrew/test/cmd/config_spec.rb
@@ -0,0 +1,8 @@
+describe "brew config", :integration_test do
+ it "prints information about the current Homebrew configuration" do
+ expect { brew "config" }
+ .to output(/HOMEBREW_VERSION: #{HOMEBREW_VERSION}/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/custom-external-command_spec.rb b/Library/Homebrew/test/cmd/custom-external-command_spec.rb
new file mode 100644
index 000000000..8ccc21fa7
--- /dev/null
+++ b/Library/Homebrew/test/cmd/custom-external-command_spec.rb
@@ -0,0 +1,21 @@
+describe "brew custom-external-command", :integration_test do
+ it "is supported" do
+ Dir.mktmpdir do |path|
+ path = Pathname.new(path)
+
+ cmd = "custom-external-command-#{rand}"
+ file = path/"brew-#{cmd}"
+
+ file.write <<-EOS.undent
+ #!/bin/sh
+ echo 'I am #{cmd}.'
+ EOS
+ FileUtils.chmod "+x", file
+
+ expect { brew cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" }
+ .to output("I am #{cmd}.\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/doctor_spec.rb b/Library/Homebrew/test/cmd/doctor_spec.rb
new file mode 100644
index 000000000..530adcd98
--- /dev/null
+++ b/Library/Homebrew/test/cmd/doctor_spec.rb
@@ -0,0 +1,6 @@
+describe "brew doctor", :integration_test do
+ specify "check_integration_test" do
+ expect { brew "doctor", "check_integration_test" }
+ .to output(/This is an integration test/).to_stderr
+ end
+end
diff --git a/Library/Homebrew/test/cmd/fetch_spec.rb b/Library/Homebrew/test/cmd/fetch_spec.rb
new file mode 100644
index 000000000..111d9f85c
--- /dev/null
+++ b/Library/Homebrew/test/cmd/fetch_spec.rb
@@ -0,0 +1,13 @@
+describe "brew fetch", :integration_test do
+ it "downloads the Formula's URL" do
+ setup_test_formula "testball"
+
+ expect(HOMEBREW_CACHE/"testball-0.1.tbz").not_to exist
+
+ shutup do
+ expect { brew "fetch", "testball" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CACHE/"testball-0.1.tbz").to exist
+ end
+end
diff --git a/Library/Homebrew/test/cmd/help_spec.rb b/Library/Homebrew/test/cmd/help_spec.rb
new file mode 100644
index 000000000..6d94d7444
--- /dev/null
+++ b/Library/Homebrew/test/cmd/help_spec.rb
@@ -0,0 +1,47 @@
+describe "brew", :integration_test do
+ it "prints help when no argument is given" do
+ expect { brew }
+ .to output(/Example usage:\n/).to_stderr
+ .and be_a_failure
+ end
+
+ describe "help" do
+ it "prints help" do
+ expect { brew "help" }
+ .to output(/Example usage:\n/).to_stdout
+ .and be_a_success
+ end
+
+ it "prints help for a documented Ruby command" do
+ expect { brew "help", "cat" }
+ .to output(/^brew cat/).to_stdout
+ .and be_a_success
+ end
+
+ it "prints help for a documented shell command" do
+ expect { brew "help", "update" }
+ .to output(/^brew update/).to_stdout
+ .and be_a_success
+ end
+
+ it "prints help for a documented Ruby developer command" do
+ expect { brew "help", "update-test" }
+ .to output(/^brew update-test/).to_stdout
+ .and be_a_success
+ end
+
+ it "fails when given an unknown command" do
+ expect { brew "help", "command-that-does-not-exist" }
+ .to output(/Unknown command: command-that-does-not-exist/).to_stderr
+ .and be_a_failure
+ end
+ end
+
+ describe "cat" do
+ it "prints help when no argument is given" do
+ expect { brew "cat" }
+ .to output(/^brew cat/).to_stderr
+ .and be_a_failure
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/home_spec.rb b/Library/Homebrew/test/cmd/home_spec.rb
new file mode 100644
index 000000000..5a4070492
--- /dev/null
+++ b/Library/Homebrew/test/cmd/home_spec.rb
@@ -0,0 +1,17 @@
+describe "brew home", :integration_test do
+ it "opens the Homebrew homepage when no argument is given" do
+ expect { brew "home", "HOMEBREW_BROWSER" => "echo" }
+ .to output("#{HOMEBREW_WWW}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "opens the homepage for a given Formula" do
+ setup_test_formula "testball"
+
+ expect { brew "home", "testball", "HOMEBREW_BROWSER" => "echo" }
+ .to output("#{Formula["testball"].homepage}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/irb_spec.rb b/Library/Homebrew/test/cmd/irb_spec.rb
new file mode 100644
index 000000000..44410fabe
--- /dev/null
+++ b/Library/Homebrew/test/cmd/irb_spec.rb
@@ -0,0 +1,24 @@
+describe "brew irb", :integration_test do
+ it "starts an interactive Homebrew shell session" do
+ setup_test_formula "testball"
+
+ irb_test = HOMEBREW_TEMP/"irb-test.rb"
+ irb_test.write <<-EOS.undent
+ "testball".f
+ :testball.f
+ exit
+ EOS
+
+ expect { brew "irb", irb_test }
+ .to output(/Interactive Homebrew Shell/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ specify "--examples" do
+ expect { brew "irb", "--examples" }
+ .to output(/'v8'\.f # => instance of the v8 formula/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/leaves_spec.rb b/Library/Homebrew/test/cmd/leaves_spec.rb
new file mode 100644
index 000000000..cd93d7e3d
--- /dev/null
+++ b/Library/Homebrew/test/cmd/leaves_spec.rb
@@ -0,0 +1,23 @@
+describe "brew leaves", :integration_test do
+ it "prints all Formulae that are not dependencies of other Formulae" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+
+ expect { brew "leaves" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ (HOMEBREW_CELLAR/"foo/0.1/somedir").mkpath
+ expect { brew "leaves" }
+ .to output("foo\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ (HOMEBREW_CELLAR/"bar/0.1/somedir").mkpath
+ expect { brew "leaves" }
+ .to output("bar\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/link_spec.rb b/Library/Homebrew/test/cmd/link_spec.rb
new file mode 100644
index 000000000..7b85c96dc
--- /dev/null
+++ b/Library/Homebrew/test/cmd/link_spec.rb
@@ -0,0 +1,56 @@
+describe "brew link", :integration_test do
+ it "fails when no argument is given" do
+ expect { brew "link" }
+ .to output(/This command requires a keg argument/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "does not fail if the given Formula is already linked" do
+ setup_test_formula "testball1"
+
+ shutup do
+ expect { brew "install", "testball1" }.to be_a_success
+ expect { brew "link", "testball1" }.to be_a_success
+ end
+ end
+
+ it "links a given Formula" do
+ setup_test_formula "testball1"
+
+ shutup do
+ expect { brew "install", "testball1" }.to be_a_success
+ expect { brew "unlink", "testball1" }.to be_a_success
+ end
+
+ expect { brew "link", "--dry-run", "testball1" }
+ .to output(/Would link/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "link", "--dry-run", "--overwrite", "testball1" }
+ .to output(/Would remove/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "link", "testball1" }
+ .to output(/Linking/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "refuses to link keg-only Formulae" do
+ setup_test_formula "testball1", <<-EOS.undent
+ keg_only "just because"
+ EOS
+
+ shutup do
+ expect { brew "install", "testball1" }.to be_a_success
+ end
+
+ expect { brew "link", "testball1" }
+ .to output(/testball1 is keg-only/).to_stderr
+ .and output(/Note that doing so can interfere with building software\./).to_stdout
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/linkapps_spec.rb b/Library/Homebrew/test/cmd/linkapps_spec.rb
new file mode 100644
index 000000000..42118a215
--- /dev/null
+++ b/Library/Homebrew/test/cmd/linkapps_spec.rb
@@ -0,0 +1,24 @@
+describe "brew linkapps", :integration_test do
+ let(:home_dir) { @home_dir = Pathname.new(Dir.mktmpdir) }
+ let(:apps_dir) { home_dir/"Applications" }
+
+ after(:each) do
+ home_dir.rmtree unless @home_dir.nil?
+ end
+
+ it "symlinks applications" do
+ apps_dir.mkpath
+
+ setup_test_formula "testball"
+
+ source_app = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
+ source_app.mkpath
+
+ expect { brew "linkapps", "--local", "HOME" => home_dir }
+ .to output(/Linking: #{Regexp.escape(source_app)}/).to_stdout
+ .and output(/`brew linkapps` has been deprecated/).to_stderr
+ .and be_a_success
+
+ expect(apps_dir/"TestBall.app").to be_a_symlink
+ end
+end
diff --git a/Library/Homebrew/test/cmd/list_spec.rb b/Library/Homebrew/test/cmd/list_spec.rb
new file mode 100644
index 000000000..df7394d7b
--- /dev/null
+++ b/Library/Homebrew/test/cmd/list_spec.rb
@@ -0,0 +1,14 @@
+describe "brew list", :integration_test do
+ let(:formulae) { %w[bar foo qux] }
+
+ it "prints all installed Formulae" do
+ formulae.each do |f|
+ (HOMEBREW_CELLAR/f/"1.0/somedir").mkpath
+ end
+
+ expect { brew "list" }
+ .to output("#{formulae.join("\n")}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/log_spec.rb b/Library/Homebrew/test/cmd/log_spec.rb
new file mode 100644
index 000000000..bdbca8912
--- /dev/null
+++ b/Library/Homebrew/test/cmd/log_spec.rb
@@ -0,0 +1,41 @@
+describe "brew log", :integration_test do
+ it "shows the Git log for the Homebrew repository when no argument is given" do
+ HOMEBREW_REPOSITORY.cd do
+ shutup do
+ system "git", "init"
+ system "git", "commit", "--allow-empty", "-m", "This is a test commit"
+ end
+ end
+
+ expect { brew "log" }
+ .to output(/This is a test commit/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "shows the Git log for a given Formula" do
+ setup_test_formula "testball"
+
+ core_tap = CoreTap.new
+ core_tap.path.cd do
+ shutup do
+ system "git", "init"
+ system "git", "add", "--all"
+ system "git", "commit", "-m", "This is a test commit for Testball"
+ end
+ end
+
+ core_tap_url = "file://#{core_tap.path}"
+ shallow_tap = Tap.fetch("homebrew", "shallow")
+ shutup do
+ system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path
+ end
+
+ expect { brew "log", "#{shallow_tap}/testball" }
+ .to output(/This is a test commit for Testball/).to_stdout
+ .and output(/Warning: The git repository is a shallow clone/).to_stderr
+ .and be_a_success
+
+ expect(shallow_tap.path/".git/shallow").to exist, "A shallow clone should have been created."
+ end
+end
diff --git a/Library/Homebrew/test/cmd/migrate_spec.rb b/Library/Homebrew/test/cmd/migrate_spec.rb
new file mode 100644
index 000000000..18c94fa01
--- /dev/null
+++ b/Library/Homebrew/test/cmd/migrate_spec.rb
@@ -0,0 +1,46 @@
+describe "brew migrate", :integration_test do
+ before(:each) do
+ setup_test_formula "testball1"
+ setup_test_formula "testball2"
+ end
+
+ it "fails when no argument is given" do
+ expect { brew "migrate" }
+ .to output(/Invalid usage/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "fails when a given Formula doesn't exist" do
+ expect { brew "migrate", "testball" }
+ .to output(/No available formula with the name "testball"/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "fails if a given Formula doesn't replace another one" do
+ expect { brew "migrate", "testball1" }
+ .to output(/testball1 doesn't replace any formula/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "migrates a renamed Formula" do
+ install_and_rename_coretap_formula "testball1", "testball2"
+
+ expect { brew "migrate", "testball1" }
+ .to output(/Migrating testball1 to testball2/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "fails if a given Formula is not installed" do
+ install_and_rename_coretap_formula "testball1", "testball2"
+ (HOMEBREW_CELLAR/"testball1").rmtree
+
+ expect { brew "migrate", "testball1" }
+ .to output(/Error: No such keg/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+end
diff --git a/Library/Homebrew/test/cmd/missing_spec.rb b/Library/Homebrew/test/cmd/missing_spec.rb
new file mode 100644
index 000000000..4668e72e0
--- /dev/null
+++ b/Library/Homebrew/test/cmd/missing_spec.rb
@@ -0,0 +1,41 @@
+describe "brew missing", :integration_test do
+ before(:each) do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+ end
+
+ def make_prefix(name)
+ (HOMEBREW_CELLAR/name/"1.0").mkpath
+ end
+
+ it "prints missing dependencies" do
+ make_prefix "bar"
+
+ expect { brew "missing" }
+ .to output("foo\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "prints nothing if all dependencies are installed" do
+ make_prefix "foo"
+ make_prefix "bar"
+
+ expect { brew "missing" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+ end
+
+ describe "--hide=" do
+ it "pretends that the specified Formulae are not installed" do
+ make_prefix "foo"
+ make_prefix "bar"
+
+ expect { brew "missing", "--hide=foo" }
+ .to output("bar: foo\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/options_spec.rb b/Library/Homebrew/test/cmd/options_spec.rb
new file mode 100644
index 000000000..33fe8b107
--- /dev/null
+++ b/Library/Homebrew/test/cmd/options_spec.rb
@@ -0,0 +1,12 @@
+describe "brew options", :integration_test do
+ it "prints a given Formula's options" do
+ setup_test_formula "testball", <<-EOS.undent
+ depends_on "bar" => :recommended
+ EOS
+
+ expect { brew "options", "testball" }
+ .to output("--with-foo\n\tBuild with foo\n--without-bar\n\tBuild without bar support\n\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/outdated_spec.rb b/Library/Homebrew/test/cmd/outdated_spec.rb
new file mode 100644
index 000000000..2ce0825e8
--- /dev/null
+++ b/Library/Homebrew/test/cmd/outdated_spec.rb
@@ -0,0 +1,11 @@
+describe "brew outdated", :integration_test do
+ it "prints outdated Formulae" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ expect { brew "outdated" }
+ .to output("testball\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/pin_spec.rb b/Library/Homebrew/test/cmd/pin_spec.rb
new file mode 100644
index 000000000..9ffc052c3
--- /dev/null
+++ b/Library/Homebrew/test/cmd/pin_spec.rb
@@ -0,0 +1,13 @@
+describe "brew pin", :integration_test do
+ it "pins a Formula's version" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ shutup do
+ expect { brew "pin", "testball" }.to be_a_success
+ expect { brew "upgrade" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CELLAR/"testball/0.1").not_to be_a_directory
+ end
+end
diff --git a/Library/Homebrew/test/cmd/prune_spec.rb b/Library/Homebrew/test/cmd/prune_spec.rb
new file mode 100644
index 000000000..c5a9df70c
--- /dev/null
+++ b/Library/Homebrew/test/cmd/prune_spec.rb
@@ -0,0 +1,28 @@
+describe "brew prune", :integration_test do
+ it "removes empty directories and broken symlinks" do
+ share = (HOMEBREW_PREFIX/"share")
+
+ (share/"pruneable/directory/here").mkpath
+ (share/"notpruneable/file").write "I'm here"
+ FileUtils.ln_s "/i/dont/exist/no/really/i/dont", share/"pruneable_symlink"
+
+ expect { brew "prune", "--dry-run" }
+ .to output(%r{Would remove \(empty directory\): .*/pruneable/directory/here}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "prune" }
+ .to output(/Pruned 1 symbolic links and 3 directories/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect(share/"pruneable").not_to be_a_directory
+ expect(share/"notpruneable").to be_a_directory
+ expect(share/"pruneable_symlink").not_to be_a_symlink
+
+ expect { brew "prune", "--verbose" }
+ .to output(/Nothing pruned/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/readall_spec.rb b/Library/Homebrew/test/cmd/readall_spec.rb
new file mode 100644
index 000000000..9165e0cb0
--- /dev/null
+++ b/Library/Homebrew/test/cmd/readall_spec.rb
@@ -0,0 +1,20 @@
+describe "brew readall", :integration_test do
+ it "imports all Formulae for a given Tap" do
+ formula_file = setup_test_formula "testball"
+
+ alias_file = CoreTap.new.alias_dir/"foobar"
+ alias_file.parent.mkpath
+
+ FileUtils.ln_s formula_file, alias_file
+
+ expect { brew "readall", "--aliases", "--syntax" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect { brew "readall", "homebrew/core" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+ end
+end
diff --git a/Library/Homebrew/test/cmd/reinstall_spec.rb b/Library/Homebrew/test/cmd/reinstall_spec.rb
new file mode 100644
index 000000000..74d36bbb8
--- /dev/null
+++ b/Library/Homebrew/test/cmd/reinstall_spec.rb
@@ -0,0 +1,47 @@
+require "extend/ENV"
+
+describe "brew reinstall", :integration_test do
+ let(:bin) { (HOMEBREW_PREFIX/"bin").realpath }
+ let(:path) { "#{bin}#{File::PATH_SEPARATOR}#{ENV["PATH"]}" }
+
+ before(:each) do
+ setup_test_formula "testball"
+
+ shutup do
+ expect { brew "install", "testball", "--with-foo" }.to be_a_success
+ end
+ end
+
+ it "reinstalls a Formula" do
+ foo_dir = HOMEBREW_CELLAR/"testball/0.1/foo"
+ expect(foo_dir).to exist
+ foo_dir.rmtree
+
+ expect { brew "reinstall", "testball", "PATH" => path }
+ .to output(/Reinstalling testball --with-foo/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect(foo_dir).to exist
+ end
+
+ it "reinstalls a Formula even when one of the options is invalid" do
+ expect { brew "reinstall", "testball", "--with-fo", "PATH" => path }
+ .to output(/Reinstalling testball --with-foo/).to_stdout
+ .and output(/testball: this formula has no \-\-with-fo option so it will be ignored!/).to_stderr
+ .and be_a_success
+ end
+
+ it "refuses to reinstall a pinned Formula, but doesn't fail" do
+ (HOMEBREW_CELLAR/"testball/0.1").mkpath
+ HOMEBREW_PINNED_KEGS.mkpath
+ FileUtils.ln_s HOMEBREW_CELLAR/"testball/0.1", HOMEBREW_PINNED_KEGS/"testball"
+
+ expect { brew "reinstall", "testball" }
+ .to output(/testball is pinned. You must unpin it to reinstall./).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_success
+
+ HOMEBREW_PINNED_KEGS.rmtree
+ end
+end
diff --git a/Library/Homebrew/test/cmd/search_spec.rb b/Library/Homebrew/test/cmd/search_spec.rb
new file mode 100644
index 000000000..06b7073d8
--- /dev/null
+++ b/Library/Homebrew/test/cmd/search_spec.rb
@@ -0,0 +1,57 @@
+describe "brew search", :integration_test do
+ before(:each) do
+ setup_test_formula "testball"
+ end
+
+ it "lists all available Formulae when no argument is given" do
+ expect { brew "search" }
+ .to output(/testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "supports searching by name" do
+ expect { brew "search", "testball" }
+ .to output(/testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ it "supports searching a fully-qualified name " do
+ expect { brew "search", "homebrew/homebrew-core/testball" }
+ .to output(/testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+
+ describe "--desc" do
+ let(:desc_cache) { HOMEBREW_CACHE/"desc_cache.json" }
+
+ it "supports searching in descriptions and creates a description cache" do
+ expect(desc_cache).not_to exist
+
+ expect { brew "search", "--desc", "Some test" }
+ .to output(/testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect(desc_cache).to exist
+ end
+ end
+
+ {
+ "macports" => "https://www.macports.org/ports.php?by=name&substr=testball",
+ "fink" => "http://pdb.finkproject.org/pdb/browse.php?summary=testball",
+ "debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all&section=all",
+ "opensuse" => "https://software.opensuse.org/search?q=testball",
+ "fedora" => "https://admin.fedoraproject.org/pkgdb/packages/%2Atestball%2A/",
+ "ubuntu" => "http://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all&section=all",
+ }.each do |flag, url|
+ specify "--#{flag}" do
+ expect { brew "search", "--#{flag}", "testball", "HOMEBREW_BROWSER" => "echo" }
+ .to output("#{url}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/services_spec.rb b/Library/Homebrew/test/cmd/services_spec.rb
new file mode 100644
index 000000000..c456fea17
--- /dev/null
+++ b/Library/Homebrew/test/cmd/services_spec.rb
@@ -0,0 +1,10 @@
+describe "brew services", :integration_test, :needs_macos, :needs_official_cmd_taps do
+ it "allows controlling services" do
+ setup_remote_tap "homebrew/services"
+
+ expect { brew "services", "list" }
+ .to output("Warning: No services available to control with `brew services`\n").to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/sh_spec.rb b/Library/Homebrew/test/cmd/sh_spec.rb
new file mode 100644
index 000000000..5260ddb75
--- /dev/null
+++ b/Library/Homebrew/test/cmd/sh_spec.rb
@@ -0,0 +1,8 @@
+describe "brew sh", :integration_test do
+ it "runs a shell with the Homebrew environment" do
+ expect { brew "sh", "SHELL" => which("true") }
+ .to output(/Your shell has been configured/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/tap-new_spec.rb b/Library/Homebrew/test/cmd/tap-new_spec.rb
new file mode 100644
index 000000000..ea4b8aa73
--- /dev/null
+++ b/Library/Homebrew/test/cmd/tap-new_spec.rb
@@ -0,0 +1,10 @@
+describe "brew tap-new", :integration_test do
+ it "initializes a new Tap with a ReadMe file" do
+ expect { brew "tap-new", "homebrew/foo", "--verbose" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect(HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo/README.md").to exist
+ end
+end
diff --git a/Library/Homebrew/test/cmd/uninstall_spec.rb b/Library/Homebrew/test/cmd/uninstall_spec.rb
new file mode 100644
index 000000000..65f69e802
--- /dev/null
+++ b/Library/Homebrew/test/cmd/uninstall_spec.rb
@@ -0,0 +1,12 @@
+describe "brew uninstall", :integration_test do
+ it "uninstalls a given Formula" do
+ shutup do
+ expect { brew "install", testball }.to be_a_success
+ end
+
+ expect { brew "uninstall", "--force", testball }
+ .to output(/Uninstalling testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/unlink_spec.rb b/Library/Homebrew/test/cmd/unlink_spec.rb
new file mode 100644
index 000000000..5961651fe
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unlink_spec.rb
@@ -0,0 +1,14 @@
+describe "brew unlink", :integration_test do
+ it "unlinks a Formula" do
+ setup_test_formula "testball"
+
+ shutup do
+ expect { brew "install", "testball" }.to be_a_success
+ end
+
+ expect { brew "unlink", "--dry-run", "testball" }
+ .to output(/Would remove/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/unlinkapps_spec.rb b/Library/Homebrew/test/cmd/unlinkapps_spec.rb
new file mode 100644
index 000000000..1e21bd851
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unlinkapps_spec.rb
@@ -0,0 +1,24 @@
+describe "brew unlinkapps", :integration_test do
+ let(:home_dir) { @home_dir = Pathname.new(Dir.mktmpdir) }
+ let(:apps_dir) { home_dir/"Applications" }
+
+ after(:each) do
+ home_dir.rmtree unless @home_dir.nil?
+ end
+
+ it "unlinks symlinked applications" do
+ apps_dir.mkpath
+
+ setup_test_formula "testball"
+
+ source_app = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
+ source_app.mkpath
+
+ FileUtils.ln_s source_app, apps_dir/"TestBall.app"
+
+ expect { brew "unlinkapps", "--local", "HOME" => home_dir }
+ .to output(%r{Unlinking: #{Regexp.escape(apps_dir)}/TestBall.app}).to_stdout
+ .and output(/`brew unlinkapps` has been deprecated/).to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/cmd/unpack_spec.rb b/Library/Homebrew/test/cmd/unpack_spec.rb
new file mode 100644
index 000000000..244fc0852
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unpack_spec.rb
@@ -0,0 +1,16 @@
+describe "brew unpack", :integration_test do
+ it "unpacks a given Formula's archive" do
+ setup_test_formula "testball"
+
+ Dir.mktmpdir do |path|
+ path = Pathname.new(path)
+
+ shutup do
+ expect { brew "unpack", "testball", "--destdir=#{path}" }
+ .to be_a_success
+ end
+
+ expect(path/"testball-0.1").to be_a_directory
+ end
+ end
+end
diff --git a/Library/Homebrew/test/cmd/unpin_spec.rb b/Library/Homebrew/test/cmd/unpin_spec.rb
new file mode 100644
index 000000000..4f14626d8
--- /dev/null
+++ b/Library/Homebrew/test/cmd/unpin_spec.rb
@@ -0,0 +1,14 @@
+describe "brew unpin", :integration_test do
+ it "unpins a Formula's version" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ shutup do
+ expect { brew "pin", "testball" }.to be_a_success
+ expect { brew "unpin", "testball" }.to be_a_success
+ expect { brew "upgrade" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory
+ end
+end
diff --git a/Library/Homebrew/test/cmd/upgrade_spec.rb b/Library/Homebrew/test/cmd/upgrade_spec.rb
new file mode 100644
index 000000000..84f5c09f4
--- /dev/null
+++ b/Library/Homebrew/test/cmd/upgrade_spec.rb
@@ -0,0 +1,12 @@
+describe "brew upgrade", :integration_test do
+ it "upgrades a Formula to the latest version" do
+ setup_test_formula "testball"
+ (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
+
+ shutup do
+ expect { brew "upgrade" }.to be_a_success
+ end
+
+ expect(HOMEBREW_CELLAR/"testball/0.1").to be_a_directory
+ end
+end
diff --git a/Library/Homebrew/test/cmd/uses_spec.rb b/Library/Homebrew/test/cmd/uses_spec.rb
new file mode 100644
index 000000000..2a6f48cb7
--- /dev/null
+++ b/Library/Homebrew/test/cmd/uses_spec.rb
@@ -0,0 +1,25 @@
+describe "brew uses", :integration_test do
+ it "prints the Formulae a given Formula is used by" do
+ setup_test_formula "foo"
+ setup_test_formula "bar"
+ setup_test_formula "baz", <<-EOS.undent
+ url "https://example.com/baz-1.0"
+ depends_on "bar"
+ EOS
+
+ expect { brew "uses", "baz" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect { brew "uses", "bar" }
+ .to output("baz\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "uses", "--recursive", "foo" }
+ .to output(/(bar\nbaz|baz\nbar)/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/command_test.rb b/Library/Homebrew/test/command_test.rb
deleted file mode 100644
index d5c7aaa88..000000000
--- a/Library/Homebrew/test/command_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCommand < IntegrationCommandTestCase
- def test_command
- assert_equal "#{HOMEBREW_LIBRARY_PATH}/cmd/info.rb",
- cmd("command", "info")
-
- assert_match "Unknown command",
- cmd_fail("command", "I-don't-exist")
- end
-end
diff --git a/Library/Homebrew/test/commands_test.rb b/Library/Homebrew/test/commands_test.rb
index 5f5dc9586..da88ee2d5 100644
--- a/Library/Homebrew/test/commands_test.rb
+++ b/Library/Homebrew/test/commands_test.rb
@@ -4,13 +4,6 @@ require "cmd/commands"
require "fileutils"
require "testing_env"
-class IntegrationCommandTestCommands < IntegrationCommandTestCase
- def test_commands
- assert_match "Built-in commands",
- cmd("commands")
- end
-end
-
class CommandsTests < Homebrew::TestCase
def setup
super
diff --git a/Library/Homebrew/test/config_test.rb b/Library/Homebrew/test/config_test.rb
deleted file mode 100644
index 81da4660a..000000000
--- a/Library/Homebrew/test/config_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestConfig < IntegrationCommandTestCase
- def test_config
- assert_match "HOMEBREW_VERSION: #{HOMEBREW_VERSION}",
- cmd("config")
- end
-end
diff --git a/Library/Homebrew/test/create_test.rb b/Library/Homebrew/test/create_test.rb
deleted file mode 100644
index aeee428aa..000000000
--- a/Library/Homebrew/test/create_test.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCreate < IntegrationCommandTestCase
- def test_create
- url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
- cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat")
-
- formula_file = CoreTap.new.formula_dir/"testball.rb"
- assert formula_file.exist?, "The formula source should have been created"
- assert_match %Q(sha256 "#{TESTBALL_SHA256}"), formula_file.read
- end
-end
diff --git a/Library/Homebrew/test/custom_command_test.rb b/Library/Homebrew/test/custom_command_test.rb
deleted file mode 100644
index 8d05bc6c7..000000000
--- a/Library/Homebrew/test/custom_command_test.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase
- def test_custom_command
- mktmpdir do |path|
- cmd = "int-test-#{rand}"
- file = "#{path}/brew-#{cmd}"
-
- File.open(file, "w") do |f|
- f.write "#!/bin/sh\necho 'I am #{cmd}'\n"
- end
- FileUtils.chmod 0777, file
-
- assert_match "I am #{cmd}",
- cmd(cmd, "PATH" => "#{path}#{File::PATH_SEPARATOR}#{ENV["PATH"]}")
- end
- end
-end
diff --git a/Library/Homebrew/test/dev-cmd/bottle_spec.rb b/Library/Homebrew/test/dev-cmd/bottle_spec.rb
new file mode 100644
index 000000000..468ef2e90
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/bottle_spec.rb
@@ -0,0 +1,30 @@
+describe "brew bottle", :integration_test do
+ it "builds a bottle for the given Formula" do
+ begin
+ shutup do
+ expect { brew "install", "--build-bottle", testball }
+ .to be_a_success
+ end
+
+ expect { brew "bottle", "--no-rebuild", testball }
+ .to output(/Formula not from core or any taps/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+
+ setup_test_formula "testball"
+
+ # `brew bottle` should not fail with dead symlink
+ # https://github.com/Homebrew/legacy-homebrew/issues/49007
+ (HOMEBREW_CELLAR/"testball/0.1").cd do
+ FileUtils.ln_s "not-exist", "symlink"
+ end
+
+ expect { brew "bottle", "--no-rebuild", "testball" }
+ .to output(/testball-0\.1.*\.bottle\.tar\.gz/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ ensure
+ FileUtils.rm_f Dir.glob("testball-0.1*.bottle.tar.gz")
+ end
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/create_spec.rb b/Library/Homebrew/test/dev-cmd/create_spec.rb
new file mode 100644
index 000000000..b7f96ec7f
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/create_spec.rb
@@ -0,0 +1,13 @@
+describe "brew create", :integration_test do
+ let(:url) { "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz" }
+ let(:formula_file) { CoreTap.new.formula_dir/"testball.rb" }
+
+ it "creates a new Formula file for a given URL" do
+ shutup do
+ brew "create", url, "HOMEBREW_EDITOR" => "/bin/cat"
+ end
+
+ expect(formula_file).to exist
+ expect(formula_file.read).to match(%Q(sha256 "#{TESTBALL_SHA256}"))
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/edit_spec.rb b/Library/Homebrew/test/dev-cmd/edit_spec.rb
new file mode 100644
index 000000000..5cedb0524
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/edit_spec.rb
@@ -0,0 +1,16 @@
+describe "brew edit", :integration_test do
+ it "opens a given Formula in an editor" do
+ HOMEBREW_REPOSITORY.cd do
+ shutup do
+ system "git", "init"
+ end
+ end
+
+ setup_test_formula "testball"
+
+ expect { brew "edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat" }
+ .to output(/# something here/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/formula_spec.rb b/Library/Homebrew/test/dev-cmd/formula_spec.rb
new file mode 100644
index 000000000..cc5b3e9e8
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/formula_spec.rb
@@ -0,0 +1,10 @@
+describe "brew formula", :integration_test do
+ it "prints a given Formula's path" do
+ formula_file = setup_test_formula "testball"
+
+ expect { brew "formula", "testball" }
+ .to output("#{formula_file}\n").to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/pull_spec.rb b/Library/Homebrew/test/dev-cmd/pull_spec.rb
new file mode 100644
index 000000000..3c0108df2
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/pull_spec.rb
@@ -0,0 +1,60 @@
+describe "brew pull", :integration_test do
+ it "fails when no argument is given" do
+ expect { brew "pull" }
+ .to output(/This command requires at least one argument/).to_stderr
+ .and not_to_output.to_stdout
+ .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"]
+
+ CoreTap.instance.path.cd do
+ shutup do
+ system "git", "init"
+ system "git", "checkout", "-b", "new-branch"
+ end
+ end
+
+ expect { brew "pull", "https://bot.brew.sh/job/Homebrew\%20Testing/1028/" }
+ .to output(/Testing URLs require `\-\-bottle`!/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+
+ expect { brew "pull", "1" }
+ .to output(/Fetching patch/).to_stdout
+ .and output(/Current branch is new\-branch/).to_stderr
+ .and be_a_failure
+
+ expect { brew "pull", "--bump", "8" }
+ .to output(/Fetching patch/).to_stdout
+ .and output(/No changed formulae found to bump/).to_stderr
+ .and be_a_failure
+
+ expect { brew "pull", "--bump", "https://api.github.com/repos/Homebrew/homebrew-core/pulls/122" }
+ .to output(/Fetching patch/).to_stdout
+ .and output(/Can only bump one changed formula/).to_stderr
+ .and be_a_failure
+
+ expect { brew "pull", "https://github.com/Homebrew/homebrew-core/pull/1" }
+ .to output(/Fetching patch/).to_stdout
+ .and output(/Patch failed to apply/).to_stderr
+ .and be_a_failure
+ end
+
+ describe "--rebase" do
+ it "fails" do
+ expect { brew "pull", "--rebase" }
+ .to output(/You meant `git pull --rebase`./).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+ end
+
+ it "fails when given 0" do
+ expect { brew "pull", "0" }
+ .to output(/Not a GitHub pull request or commit/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/tap_spec.rb b/Library/Homebrew/test/dev-cmd/tap_spec.rb
new file mode 100644
index 000000000..a24c67aae
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/tap_spec.rb
@@ -0,0 +1,75 @@
+describe "brew tap", :integration_test do
+ it "taps a given Tap" do
+ path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
+ path.mkpath
+ path.cd do
+ shutup do
+ system "git", "init"
+ system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo"
+ FileUtils.touch "readme"
+ system "git", "add", "--all"
+ system "git", "commit", "-m", "init"
+ end
+ end
+
+ expect { brew "tap" }
+ .to output(%r{homebrew/foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap", "--list-official" }
+ .to output(%r{homebrew/science}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap-info" }
+ .to output(/2 taps/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap-info", "homebrew/foo" }
+ .to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap-info", "--json=v1", "--installed" }
+ .to output(%r{https://github\.com/Homebrew/homebrew-foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap-pin", "homebrew/foo" }
+ .to output(%r{Pinned homebrew/foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap", "--list-pinned" }
+ .to output(%r{homebrew/foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap-unpin", "homebrew/foo" }
+ .to output(%r{Unpinned homebrew/foo}).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap", "homebrew/bar", path/".git" }
+ .to output(/Tapped/).to_stdout
+ .and output(/Cloning/).to_stderr
+ .and be_a_success
+
+ expect { brew "untap", "homebrew/bar" }
+ .to output(/Untapped/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "tap", "homebrew/bar", path/".git", "-q", "--full" }
+ .to be_a_success
+ .and not_to_output.to_stdout
+ .and not_to_output.to_stderr
+
+ expect { brew "untap", "homebrew/bar" }
+ .to output(/Untapped/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/dev-cmd/test_spec.rb b/Library/Homebrew/test/dev-cmd/test_spec.rb
new file mode 100644
index 000000000..b73d042e4
--- /dev/null
+++ b/Library/Homebrew/test/dev-cmd/test_spec.rb
@@ -0,0 +1,56 @@
+describe "brew test", :integration_test do
+ it "fails when no argument is given" do
+ expect { brew "test" }
+ .to output(/This command requires a formula argument/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "fails when a Formula is not installed" do
+ expect { brew "test", testball }
+ .to output(/Testing requires the latest version of testball/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "fails when a Formula has no test" do
+ shutup do
+ expect { brew "install", testball }.to be_a_success
+ end
+
+ expect { brew "test", testball }
+ .to output(/testball defines no test/).to_stderr
+ .and not_to_output.to_stdout
+ .and be_a_failure
+ end
+
+ it "tests a given Formula" do
+ setup_test_formula "testball", <<-EOS.undent
+ head "https://github.com/example/testball2.git"
+
+ devel do
+ url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
+ sha256 "#{TESTBALL_SHA256}"
+ end
+
+ keg_only "just because"
+
+ test do
+ end
+ EOS
+
+ shutup do
+ expect { brew "install", "testball" }.to be_a_success
+ end
+
+ expect { brew "test", "--HEAD", "testball" }
+ .to output(/Testing testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+
+ expect { brew "test", "--devel", "testball" }
+ .to output(/Testing testball/).to_stdout
+ .and not_to_output.to_stderr
+ .and be_a_success
+ end
+end
diff --git a/Library/Homebrew/test/doctor_test.rb b/Library/Homebrew/test/doctor_test.rb
deleted file mode 100644
index d2dc871f4..000000000
--- a/Library/Homebrew/test/doctor_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestDoctor < IntegrationCommandTestCase
- def test_doctor
- assert_match "This is an integration test",
- cmd_fail("doctor", "check_integration_test")
- end
-end
diff --git a/Library/Homebrew/test/edit_test.rb b/Library/Homebrew/test/edit_test.rb
deleted file mode 100644
index 9b6ded651..000000000
--- a/Library/Homebrew/test/edit_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestEdit < IntegrationCommandTestCase
- def test_edit
- (HOMEBREW_REPOSITORY/".git").mkpath
- setup_test_formula "testball"
-
- assert_match "# something here",
- cmd("edit", "testball", "HOMEBREW_EDITOR" => "/bin/cat")
- end
-end
diff --git a/Library/Homebrew/test/fetch_test.rb b/Library/Homebrew/test/fetch_test.rb
deleted file mode 100644
index e08e545e3..000000000
--- a/Library/Homebrew/test/fetch_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestFetch < IntegrationCommandTestCase
- def test_fetch
- setup_test_formula "testball"
-
- cmd("fetch", "testball")
- assert((HOMEBREW_CACHE/"testball-0.1.tbz").exist?,
- "The tarball should have been cached")
- end
-end
diff --git a/Library/Homebrew/test/formula_cmd_test.rb b/Library/Homebrew/test/formula_cmd_test.rb
deleted file mode 100644
index abbe42d98..000000000
--- a/Library/Homebrew/test/formula_cmd_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestFormula < IntegrationCommandTestCase
- def test_formula
- formula_file = setup_test_formula "testball"
- assert_equal formula_file.to_s, cmd("formula", "testball")
- end
-end
diff --git a/Library/Homebrew/test/help_test.rb b/Library/Homebrew/test/help_test.rb
deleted file mode 100644
index 92dd99721..000000000
--- a/Library/Homebrew/test/help_test.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestHelp < IntegrationCommandTestCase
- def test_help
- assert_match "Example usage:\n",
- cmd_fail # Generic help (empty argument list).
- assert_match "Unknown command: command-that-does-not-exist",
- cmd_fail("help", "command-that-does-not-exist")
- assert_match(/^brew cat /,
- cmd_fail("cat")) # Missing formula argument triggers help.
-
- assert_match "Example usage:\n",
- cmd("help") # Generic help.
- assert_match(/^brew cat /,
- cmd("help", "cat")) # Internal command (documented, Ruby).
- assert_match(/^brew update /,
- cmd("help", "update")) # Internal command (documented, Shell).
- assert_match(/^brew update-test /,
- cmd("help", "update-test")) # Internal developer command (documented, Ruby).
- end
-end
diff --git a/Library/Homebrew/test/home_test.rb b/Library/Homebrew/test/home_test.rb
deleted file mode 100644
index ff06b72c1..000000000
--- a/Library/Homebrew/test/home_test.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestHome < IntegrationCommandTestCase
- def test_home
- setup_test_formula "testball"
-
- assert_equal HOMEBREW_WWW,
- cmd("home", "HOMEBREW_BROWSER" => "echo")
- assert_equal Formula["testball"].homepage,
- cmd("home", "testball", "HOMEBREW_BROWSER" => "echo")
- end
-end
diff --git a/Library/Homebrew/test/irb_test.rb b/Library/Homebrew/test/irb_test.rb
deleted file mode 100644
index 832ca39a5..000000000
--- a/Library/Homebrew/test/irb_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestIrb < IntegrationCommandTestCase
- def test_irb
- assert_match "'v8'.f # => instance of the v8 formula",
- cmd("irb", "--examples")
-
- setup_test_formula "testball"
-
- irb_test = HOMEBREW_TEMP/"irb-test.rb"
- irb_test.write <<-EOS.undent
- "testball".f
- :testball.f
- exit
- EOS
-
- assert_match "Interactive Homebrew Shell", cmd("irb", irb_test)
- end
-end
diff --git a/Library/Homebrew/test/leaves_test.rb b/Library/Homebrew/test/leaves_test.rb
deleted file mode 100644
index f73fba1ea..000000000
--- a/Library/Homebrew/test/leaves_test.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLeaves < IntegrationCommandTestCase
- def test_leaves
- setup_test_formula "foo"
- setup_test_formula "bar"
- assert_equal "", cmd("leaves")
-
- (HOMEBREW_CELLAR/"foo/0.1/somedir").mkpath
- assert_equal "foo", cmd("leaves")
-
- (HOMEBREW_CELLAR/"bar/0.1/somedir").mkpath
- assert_equal "bar", cmd("leaves")
- end
-end
diff --git a/Library/Homebrew/test/link_test.rb b/Library/Homebrew/test/link_test.rb
deleted file mode 100644
index 062caa0c0..000000000
--- a/Library/Homebrew/test/link_test.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLink < IntegrationCommandTestCase
- def test_link
- assert_match "This command requires a keg argument", cmd_fail("link")
-
- setup_test_formula "testball1"
- cmd("install", "testball1")
- cmd("link", "testball1")
-
- cmd("unlink", "testball1")
- assert_match "Would link", cmd("link", "--dry-run", "testball1")
- assert_match "Would remove",
- cmd("link", "--dry-run", "--overwrite", "testball1")
- assert_match "Linking", cmd("link", "testball1")
-
- setup_test_formula "testball2", <<-EOS.undent
- keg_only "just because"
- EOS
- cmd("install", "testball2")
- assert_match "testball2 is keg-only", cmd("link", "testball2")
- end
-end
diff --git a/Library/Homebrew/test/linkapps_test.rb b/Library/Homebrew/test/linkapps_test.rb
deleted file mode 100644
index 4c5b8ec13..000000000
--- a/Library/Homebrew/test/linkapps_test.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLinkapps < IntegrationCommandTestCase
- def test_linkapps
- home_dir = Pathname.new(mktmpdir)
- (home_dir/"Applications").mkpath
-
- setup_test_formula "testball"
-
- source_dir = HOMEBREW_CELLAR/"testball/0.1/TestBall.app"
- source_dir.mkpath
- assert_match "Linking: #{source_dir}",
- cmd("linkapps", "--local", "HOME" => home_dir)
- end
-end
diff --git a/Library/Homebrew/test/list_test.rb b/Library/Homebrew/test/list_test.rb
deleted file mode 100644
index 3c691e3ad..000000000
--- a/Library/Homebrew/test/list_test.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestList < IntegrationCommandTestCase
- def test_list
- formulae = %w[bar foo qux]
- formulae.each do |f|
- (HOMEBREW_CELLAR/"#{f}/1.0/somedir").mkpath
- end
-
- assert_equal formulae.join("\n"),
- cmd("list")
- end
-end
diff --git a/Library/Homebrew/test/log_formula_test.rb b/Library/Homebrew/test/log_formula_test.rb
deleted file mode 100644
index bb6a1f661..000000000
--- a/Library/Homebrew/test/log_formula_test.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
- def test_log_formula
- core_tap = CoreTap.new
- setup_test_formula "testball"
-
- core_tap.path.cd do
- shutup do
- system "git", "init"
- system "git", "add", "--all"
- system "git", "commit", "-m", "This is a test commit for Testball"
- end
- end
-
- core_tap_url = "file://#{core_tap.path}"
- shallow_tap = Tap.fetch("homebrew", "shallow")
- shutup do
- system "git", "clone", "--depth=1", core_tap_url, shallow_tap.path
- end
-
- assert_match "This is a test commit for Testball",
- cmd("log", "#{shallow_tap}/testball")
- assert_predicate shallow_tap.path/".git/shallow", :exist?,
- "A shallow clone should have been created."
- end
-end
diff --git a/Library/Homebrew/test/log_test.rb b/Library/Homebrew/test/log_test.rb
deleted file mode 100644
index b2e150ccd..000000000
--- a/Library/Homebrew/test/log_test.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestLog < IntegrationCommandTestCase
- def test_log
- FileUtils.cd HOMEBREW_REPOSITORY do
- shutup do
- system "git", "init"
- system "git", "commit", "--allow-empty", "-m", "This is a test commit"
- end
- end
- assert_match "This is a test commit", cmd("log")
- end
-end
diff --git a/Library/Homebrew/test/migrate_test.rb b/Library/Homebrew/test/migrate_test.rb
deleted file mode 100644
index 17929d038..000000000
--- a/Library/Homebrew/test/migrate_test.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestMigrate < IntegrationCommandTestCase
- def test_migrate
- setup_test_formula "testball1"
- setup_test_formula "testball2"
- assert_match "Invalid usage", cmd_fail("migrate")
- assert_match "No available formula with the name \"testball\"",
- cmd_fail("migrate", "testball")
- assert_match "testball1 doesn't replace any formula",
- cmd_fail("migrate", "testball1")
-
- install_and_rename_coretap_formula "testball1", "testball2"
- assert_match "Migrating testball1 to testball2", cmd("migrate", "testball1")
- (HOMEBREW_CELLAR/"testball1").unlink
- assert_match "Error: No such keg", cmd_fail("migrate", "testball1")
- end
-end
diff --git a/Library/Homebrew/test/missing_test.rb b/Library/Homebrew/test/missing_test.rb
deleted file mode 100644
index 4f20d8a7a..000000000
--- a/Library/Homebrew/test/missing_test.rb
+++ /dev/null
@@ -1,34 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestMissing < IntegrationCommandTestCase
- def setup
- super
-
- setup_test_formula "foo"
- setup_test_formula "bar"
- end
-
- def make_prefix(name)
- (HOMEBREW_CELLAR/name/"1.0").mkpath
- end
-
- def test_missing_missing
- make_prefix "bar"
-
- assert_match "foo", cmd("missing")
- end
-
- def test_missing_not_missing
- make_prefix "foo"
- make_prefix "bar"
-
- assert_empty cmd("missing")
- end
-
- def test_missing_hide
- make_prefix "foo"
- make_prefix "bar"
-
- assert_match "foo", cmd("missing", "--hide=foo")
- end
-end
diff --git a/Library/Homebrew/test/options_test.rb b/Library/Homebrew/test/options_test.rb
index 09ea14180..0a6e198d3 100644
--- a/Library/Homebrew/test/options_test.rb
+++ b/Library/Homebrew/test/options_test.rb
@@ -1,17 +1,5 @@
require "testing_env"
require "options"
-require "testing_env"
-
-class IntegrationCommandTestOptions < IntegrationCommandTestCase
- def test_options
- setup_test_formula "testball", <<-EOS.undent
- depends_on "bar" => :recommended
- EOS
-
- assert_equal "--with-foo\n\tBuild with foo\n--without-bar\n\tBuild without bar support",
- cmd("options", "testball").chomp
- end
-end
class OptionTests < Homebrew::TestCase
def setup
diff --git a/Library/Homebrew/test/outdated_test.rb b/Library/Homebrew/test/outdated_test.rb
deleted file mode 100644
index 3e7148ded..000000000
--- a/Library/Homebrew/test/outdated_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestOutdated < IntegrationCommandTestCase
- def test_outdated
- setup_test_formula "testball"
- (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
-
- assert_equal "testball", cmd("outdated")
- end
-end
diff --git a/Library/Homebrew/test/pin_unpin_test.rb b/Library/Homebrew/test/pin_unpin_test.rb
deleted file mode 100644
index 65fb9e4da..000000000
--- a/Library/Homebrew/test/pin_unpin_test.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase
- def test_pin_unpin
- setup_test_formula "testball"
- (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
-
- cmd("pin", "testball")
- cmd("upgrade")
- refute((HOMEBREW_CELLAR/"testball/0.1").directory?,
- "The latest version directory should NOT be created")
-
- cmd("unpin", "testball")
- cmd("upgrade")
- assert((HOMEBREW_CELLAR/"testball/0.1").directory?,
- "The latest version directory should be created")
- end
-end
diff --git a/Library/Homebrew/test/prefix_formula_test.rb b/Library/Homebrew/test/prefix_formula_test.rb
deleted file mode 100644
index eb5970d3e..000000000
--- a/Library/Homebrew/test/prefix_formula_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPrefixFormula < IntegrationCommandTestCase
- def test_prefix_formula
- assert_match "#{HOMEBREW_CELLAR}/testball",
- cmd("--prefix", testball)
- end
-end
diff --git a/Library/Homebrew/test/prefix_test.rb b/Library/Homebrew/test/prefix_test.rb
deleted file mode 100644
index a3ae75542..000000000
--- a/Library/Homebrew/test/prefix_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPrefix < IntegrationCommandTestCase
- def test_prefix
- assert_equal HOMEBREW_PREFIX.to_s,
- cmd("--prefix")
- end
-end
diff --git a/Library/Homebrew/test/prune_test.rb b/Library/Homebrew/test/prune_test.rb
deleted file mode 100644
index 8fa5df7b7..000000000
--- a/Library/Homebrew/test/prune_test.rb
+++ /dev/null
@@ -1,21 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPrune < IntegrationCommandTestCase
- def test_prune
- share = (HOMEBREW_PREFIX/"share")
-
- (share/"pruneable/directory/here").mkpath
- (share/"notpruneable/file").write "I'm here"
- FileUtils.ln_s "/i/dont/exist/no/really/i/dont", share/"pruneable_symlink"
-
- assert_match %r{Would remove \(empty directory\): .*/pruneable/directory/here},
- cmd("prune", "--dry-run")
- assert_match "Pruned 1 symbolic links and 3 directories",
- cmd("prune")
- refute((share/"pruneable").directory?)
- assert((share/"notpruneable").directory?)
- refute((share/"pruneable_symlink").symlink?)
-
- assert_match "Nothing pruned", cmd("prune", "--verbose")
- end
-end
diff --git a/Library/Homebrew/test/pull_offline_test.rb b/Library/Homebrew/test/pull_offline_test.rb
deleted file mode 100644
index c9d46cd74..000000000
--- a/Library/Homebrew/test/pull_offline_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPullOffline < IntegrationCommandTestCase
- def test_pull_offline
- assert_match "You meant `git pull --rebase`.", cmd_fail("pull", "--rebase")
- assert_match "This command requires at least one argument", cmd_fail("pull")
- assert_match "Not a GitHub pull request or commit",
- cmd_fail("pull", "0")
- end
-end
diff --git a/Library/Homebrew/test/pull_test.rb b/Library/Homebrew/test/pull_test.rb
deleted file mode 100644
index 445d73cb1..000000000
--- a/Library/Homebrew/test/pull_test.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestPull < IntegrationCommandTestCase
- def test_pull
- skip "Requires network connection" if ENV["HOMEBREW_NO_GITHUB_API"]
-
- core_tap = CoreTap.new
- core_tap.path.cd do
- shutup do
- system "git", "init"
- system "git", "checkout", "-b", "new-branch"
- end
- end
-
- assert_match "Testing URLs require `--bottle`!",
- cmd_fail("pull", "https://bot.brew.sh/job/Homebrew\%20Testing/1028/")
- assert_match "Current branch is new-branch",
- cmd_fail("pull", "1")
- assert_match "No changed formulae found to bump",
- cmd_fail("pull", "--bump", "8")
- assert_match "Can only bump one changed formula",
- cmd_fail("pull", "--bump",
- "https://api.github.com/repos/Homebrew/homebrew-core/pulls/122")
- assert_match "Patch failed to apply",
- cmd_fail("pull", "https://github.com/Homebrew/homebrew-core/pull/1")
- end
-end
diff --git a/Library/Homebrew/test/readall_test.rb b/Library/Homebrew/test/readall_test.rb
deleted file mode 100644
index 3eec79dd8..000000000
--- a/Library/Homebrew/test/readall_test.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestReadall < IntegrationCommandTestCase
- def test_readall
- formula_file = setup_test_formula "testball"
- alias_file = CoreTap.new.alias_dir/"foobar"
- alias_file.parent.mkpath
- FileUtils.ln_s formula_file, alias_file
- cmd("readall", "--aliases", "--syntax")
- cmd("readall", "homebrew/core")
- end
-end
diff --git a/Library/Homebrew/test/reinstall_pinned_test.rb b/Library/Homebrew/test/reinstall_pinned_test.rb
deleted file mode 100644
index 80f5518ea..000000000
--- a/Library/Homebrew/test/reinstall_pinned_test.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestReinstallPinned < IntegrationCommandTestCase
- def test_reinstall_pinned
- setup_test_formula "testball"
-
- HOMEBREW_CELLAR.join("testball/0.1").mkpath
- HOMEBREW_PINNED_KEGS.mkpath
- FileUtils.ln_s HOMEBREW_CELLAR.join("testball/0.1"), HOMEBREW_PINNED_KEGS/"testball"
-
- assert_match "testball is pinned. You must unpin it to reinstall.", cmd("reinstall", "testball")
-
- HOMEBREW_PINNED_KEGS.rmtree
- end
-end
diff --git a/Library/Homebrew/test/reinstall_test.rb b/Library/Homebrew/test/reinstall_test.rb
deleted file mode 100644
index 2906983c3..000000000
--- a/Library/Homebrew/test/reinstall_test.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestReinstall < IntegrationCommandTestCase
- def test_reinstall
- setup_test_formula "testball"
-
- cmd("install", "testball", "--with-foo")
- foo_dir = HOMEBREW_CELLAR/"testball/0.1/foo"
- assert foo_dir.exist?
- foo_dir.rmtree
- assert_match "Reinstalling testball --with-foo",
- cmd("reinstall", "testball")
- assert foo_dir.exist?
- end
-
- def test_reinstall_with_invalid_option
- setup_test_formula "testball"
-
- cmd("install", "testball", "--with-foo")
-
- assert_match "testball: this formula has no --with-fo option so it will be ignored!",
- cmd("reinstall", "testball", "--with-fo")
- end
-end
diff --git a/Library/Homebrew/test/repository_test.rb b/Library/Homebrew/test/repository_test.rb
deleted file mode 100644
index 77967a58d..000000000
--- a/Library/Homebrew/test/repository_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestRepository < IntegrationCommandTestCase
- def test_repository
- assert_match HOMEBREW_REPOSITORY.to_s,
- cmd("--repository")
- assert_match "#{HOMEBREW_LIBRARY}/Taps/foo/homebrew-bar",
- cmd("--repository", "foo/bar")
- end
-end
diff --git a/Library/Homebrew/test/search_test.rb b/Library/Homebrew/test/search_test.rb
deleted file mode 100644
index 70b6f01fb..000000000
--- a/Library/Homebrew/test/search_test.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestSearch < IntegrationCommandTestCase
- def test_search
- setup_test_formula "testball"
- desc_cache = HOMEBREW_CACHE/"desc_cache.json"
- refute_predicate desc_cache, :exist?, "Cached file should not exist"
-
- assert_match "testball", cmd("search")
- assert_match "testball", cmd("search", "testball")
- assert_match "testball", cmd("search", "homebrew/homebrew-core/testball")
- assert_match "testball", cmd("search", "--desc", "Some test")
-
- flags = {
- "macports" => "https://www.macports.org/ports.php?by=name&substr=testball",
- "fink" => "http://pdb.finkproject.org/pdb/browse.php?summary=testball",
- "debian" => "https://packages.debian.org/search?keywords=testball&searchon=names&suite=all&section=all",
- "opensuse" => "https://software.opensuse.org/search?q=testball",
- "fedora" => "https://admin.fedoraproject.org/pkgdb/packages/%2Atestball%2A/",
- "ubuntu" => "http://packages.ubuntu.com/search?keywords=testball&searchon=names&suite=all&section=all",
- }
-
- flags.each do |flag, url|
- assert_equal url, cmd("search", "--#{flag}",
- "testball", "HOMEBREW_BROWSER" => "echo")
- end
-
- assert_predicate desc_cache, :exist?, "Cached file should exist"
- end
-end
diff --git a/Library/Homebrew/test/services_test.rb b/Library/Homebrew/test/services_test.rb
deleted file mode 100644
index 280aeb9f4..000000000
--- a/Library/Homebrew/test/services_test.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestServices < IntegrationCommandTestCase
- def test_services
- needs_test_cmd_taps
- needs_macos
- setup_remote_tap("homebrew/services")
- assert_equal "Warning: No services available to control with `brew services`",
- cmd("services", "list")
- end
-end
diff --git a/Library/Homebrew/test/sh_test.rb b/Library/Homebrew/test/sh_test.rb
deleted file mode 100644
index 48fcdc54a..000000000
--- a/Library/Homebrew/test/sh_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestSh < IntegrationCommandTestCase
- def test_sh
- assert_match "Your shell has been configured",
- cmd("sh", "SHELL" => which("true"))
- end
-end
diff --git a/Library/Homebrew/test/tap_new_test.rb b/Library/Homebrew/test/tap_new_test.rb
deleted file mode 100644
index 261a334f0..000000000
--- a/Library/Homebrew/test/tap_new_test.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestTapNew < IntegrationCommandTestCase
- def test_tap_readme
- assert_equal "", cmd("tap-new", "homebrew/foo", "--verbose")
- readme = HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo/README.md"
- assert readme.exist?, "The README should be created"
- end
-end
diff --git a/Library/Homebrew/test/tap_test.rb b/Library/Homebrew/test/tap_test.rb
index 578326cea..729fc8198 100644
--- a/Library/Homebrew/test/tap_test.rb
+++ b/Library/Homebrew/test/tap_test.rb
@@ -1,34 +1,4 @@
require "testing_env"
-require "testing_env"
-
-class IntegrationCommandTestTap < IntegrationCommandTestCase
- def test_tap
- path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
- path.mkpath
- path.cd do
- shutup do
- system "git", "init"
- system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo"
- FileUtils.touch "readme"
- system "git", "add", "--all"
- system "git", "commit", "-m", "init"
- end
- end
-
- assert_match "homebrew/foo", cmd("tap")
- assert_match "homebrew/science", cmd("tap", "--list-official")
- assert_match "2 taps", cmd("tap-info")
- assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "homebrew/foo")
- assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "--json=v1", "--installed")
- assert_match "Pinned homebrew/foo", cmd("tap-pin", "homebrew/foo")
- assert_match "homebrew/foo", cmd("tap", "--list-pinned")
- assert_match "Unpinned homebrew/foo", cmd("tap-unpin", "homebrew/foo")
- assert_match "Tapped", cmd("tap", "homebrew/bar", path/".git")
- assert_match "Untapped", cmd("untap", "homebrew/bar")
- assert_equal "", cmd("tap", "homebrew/bar", path/".git", "-q", "--full")
- assert_match "Untapped", cmd("untap", "homebrew/bar")
- end
-end
class TapTest < Homebrew::TestCase
include FileUtils
diff --git a/Library/Homebrew/test/test_formula_test.rb b/Library/Homebrew/test/test_formula_test.rb
deleted file mode 100644
index 5ad2db9e9..000000000
--- a/Library/Homebrew/test/test_formula_test.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestTestFormula < IntegrationCommandTestCase
- def test_test_formula
- assert_match "This command requires a formula argument", cmd_fail("test")
- assert_match "Testing requires the latest version of testball",
- cmd_fail("test", testball)
-
- cmd("install", testball)
- assert_match "testball defines no test", cmd_fail("test", testball)
-
- setup_test_formula "testball_copy", <<-EOS.undent
- head "https://github.com/example/testball2.git"
-
- devel do
- url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
- sha256 "#{TESTBALL_SHA256}"
- end
-
- keg_only "just because"
-
- test do
- end
- EOS
-
- cmd("install", "testball_copy")
- assert_match "Testing testball_copy", cmd("test", "--HEAD", "testball_copy")
- assert_match "Testing testball_copy", cmd("test", "--devel", "testball_copy")
- end
-end
diff --git a/Library/Homebrew/test/uninstall_test.rb b/Library/Homebrew/test/uninstall_test.rb
index 2f8bf4fff..a9230ffac 100644
--- a/Library/Homebrew/test/uninstall_test.rb
+++ b/Library/Homebrew/test/uninstall_test.rb
@@ -60,10 +60,3 @@ class UninstallTests < Homebrew::TestCase
end
end
end
-
-class IntegrationCommandTestUninstall < IntegrationCommandTestCase
- def test_uninstall
- cmd("install", testball)
- assert_match "Uninstalling testball", cmd("uninstall", "--force", testball)
- end
-end
diff --git a/Library/Homebrew/test/unlink_test.rb b/Library/Homebrew/test/unlink_test.rb
deleted file mode 100644
index 6d5cefc67..000000000
--- a/Library/Homebrew/test/unlink_test.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUnlink < IntegrationCommandTestCase
- def test_unlink
- setup_test_formula "testball"
-
- cmd("install", "testball")
- assert_match "Would remove", cmd("unlink", "--dry-run", "testball")
- end
-end
diff --git a/Library/Homebrew/test/unlinkapps_test.rb b/Library/Homebrew/test/unlinkapps_test.rb
deleted file mode 100644
index 9d9672199..000000000
--- a/Library/Homebrew/test/unlinkapps_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUnlinkapps < IntegrationCommandTestCase
- def test_unlinkapps
- home_dir = Pathname.new(mktmpdir)
- apps_dir = home_dir/"Applications"
- apps_dir.mkpath
-
- setup_test_formula "testball"
-
- source_app = (HOMEBREW_CELLAR/"testball/0.1/TestBall.app")
- source_app.mkpath
-
- FileUtils.ln_s source_app, "#{apps_dir}/TestBall.app"
-
- assert_match "Unlinking: #{apps_dir}/TestBall.app",
- cmd("unlinkapps", "--local", "HOME" => home_dir)
- end
-end
diff --git a/Library/Homebrew/test/unpack_test.rb b/Library/Homebrew/test/unpack_test.rb
deleted file mode 100644
index bbff6ad1c..000000000
--- a/Library/Homebrew/test/unpack_test.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUnpack < IntegrationCommandTestCase
- def test_unpack
- setup_test_formula "testball"
-
- mktmpdir do |path|
- cmd "unpack", "testball", "--destdir=#{path}"
- assert File.directory?("#{path}/testball-0.1"),
- "The tarball should be unpacked"
- end
- end
-end
diff --git a/Library/Homebrew/test/upgrade_test.rb b/Library/Homebrew/test/upgrade_test.rb
deleted file mode 100644
index f3f5dccc7..000000000
--- a/Library/Homebrew/test/upgrade_test.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUpgrade < IntegrationCommandTestCase
- def test_upgrade
- setup_test_formula "testball"
- (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath
-
- cmd("upgrade")
- assert((HOMEBREW_CELLAR/"testball/0.1").directory?,
- "The latest version directory should be created")
- end
-end
diff --git a/Library/Homebrew/test/uses_test.rb b/Library/Homebrew/test/uses_test.rb
deleted file mode 100644
index 1fad0da28..000000000
--- a/Library/Homebrew/test/uses_test.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestUses < IntegrationCommandTestCase
- def test_uses
- setup_test_formula "foo"
- setup_test_formula "bar"
- setup_test_formula "baz", <<-EOS.undent
- url "https://example.com/baz-1.0"
- depends_on "bar"
- EOS
-
- assert_equal "", cmd("uses", "baz")
- assert_equal "baz", cmd("uses", "bar")
- assert_match(/(bar\nbaz|baz\nbar)/, cmd("uses", "--recursive", "foo"))
- end
-end
diff --git a/Library/Homebrew/test/version_test.rb b/Library/Homebrew/test/version_test.rb
deleted file mode 100644
index e7ffbc4f6..000000000
--- a/Library/Homebrew/test/version_test.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-require "testing_env"
-
-class IntegrationCommandTestVersion < IntegrationCommandTestCase
- def test_version
- assert_match HOMEBREW_VERSION.to_s,
- cmd("--version")
- end
-end
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 70d2787d9..b129c7328 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -10,6 +10,7 @@ require "utils/github"
require "utils/hash"
require "utils/inreplace"
require "utils/popen"
+require "utils/svn"
require "utils/tty"
require "time"
diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb
index dfe47f890..1b4d24894 100644
--- a/Library/Homebrew/utils/git.rb
+++ b/Library/Homebrew/utils/git.rb
@@ -40,4 +40,9 @@ module Utils
@git_path = nil
@git_version = nil
end
+
+ def self.git_remote_exists(url)
+ return true unless git_available?
+ quiet_system "git", "ls-remote", url
+ end
end
diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb
new file mode 100644
index 000000000..fb49ac2e9
--- /dev/null
+++ b/Library/Homebrew/utils/svn.rb
@@ -0,0 +1,11 @@
+module Utils
+ def self.svn_available?
+ return @svn if instance_variable_defined?(:@svn)
+ @svn = quiet_system HOMEBREW_SHIMS_PATH/"scm/svn", "--version"
+ end
+
+ def self.svn_remote_exists(url)
+ return true unless svn_available?
+ quiet_system "svn", "ls", url, "--depth", "empty"
+ end
+end
diff --git a/README.md b/README.md
index 4b8b18de4..c9a605961 100644
--- a/README.md
+++ b/README.md
@@ -73,6 +73,10 @@ Our bottles (binary packages) are hosted by [Bintray](https://bintray.com/homebr
[![Downloads by Bintray](https://bintray.com/docs/images/downloads_by_bintray_96.png)](https://bintray.com/homebrew)
+[Our website](https://brew.sh) is hosted by [Netlify](https://www.netlify.com).
+
+[![Deploys by Netlify](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)
+
Secure password storage and syncing provided by [1Password for Teams](https://1password.com/teams/) by [AgileBits](https://agilebits.com)
[![AgileBits](https://da36klfizjv29.cloudfront.net/assets/branding/agilebits-fcca96e9b8e815c5c48c6b3e98156cb5.png)](https://agilebits.com)
diff --git a/docs/Acceptable-Formulae.md b/docs/Acceptable-Formulae.md
index 9f4fb45db..24dd7a7c4 100644
--- a/docs/Acceptable-Formulae.md
+++ b/docs/Acceptable-Formulae.md
@@ -38,7 +38,7 @@ There are exceptions:
| emacs, vim | [Too popular to move to dupes](https://github.com/Homebrew/homebrew/pull/21594#issuecomment-21968819) |
| subversion | Originally added for 10.5, but people want the latest version |
| libcurl | Some formulae require a newer version than macOS provides |
-| openssl | macOS's openssl is deprecated & outdated. |
+| openssl | macOS's openssl is deprecated & outdated |
| libxml2 | Historically, macOS's libxml2 has been buggy |
We also maintain [a tap](https://github.com/Homebrew/homebrew-dupes) that
@@ -74,7 +74,7 @@ due to upstream changes and we can’t provide [bottles](Bottles.md) for them.
### Bindings
First check that there is not already a binding available via
[`gem`](https://rubygems.org/) or [`pip`](http://www.pip-installer.org/)
-etc..
+etc.
If not, then put bindings in the formula they bind to. This is more
useful to people. Just install the stuff! Having to faff around with
diff --git a/docs/Brew-Test-Bot-For-Core-Contributors.md b/docs/Brew-Test-Bot-For-Core-Contributors.md
index f4c9a0ec6..3ed86c706 100644
--- a/docs/Brew-Test-Bot-For-Core-Contributors.md
+++ b/docs/Brew-Test-Bot-For-Core-Contributors.md
@@ -4,13 +4,13 @@ If a build has run and passed on `brew test-bot` then it can be used to quickly
There are two types of Jenkins jobs you will interact with:
-## [Homebrew Pull Requests](https://bot.brew.sh/job/Homebrew%20Core%20Pull%20Requests/)
+## [Homebrew Core Pull Requests](https://bot.brew.sh/job/Homebrew%20Core/)
This job automatically builds any pull requests submitted to Homebrew/homebrew-core. On success or failure it updates the pull request status (see more details on the [main Brew Test Bot documentation page](Brew-Test-Bot.md)). On a successful build it automatically uploads bottles.
## [Homebrew Testing](https://bot.brew.sh/job/Homebrew%20Testing/)
-This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles.
+This job is manually triggered to run [`brew test-bot`](https://github.com/Homebrew/homebrew-test-bot/blob/master/cmd/brew-test-bot.rb) with user-specified parameters. On a successful build it automatically uploads bottles.
-You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles.
+You can manually start this job with parameters to run [`brew test-bot`](https://github.com/Homebrew/homebrew-test-bot/blob/master/cmd/brew-test-bot.rb) with the same parameters. It's often useful to pass a pull request URL, a commit URL, a commit SHA-1 and/or formula names to have `brew-test-bot` test them, report the results and produce bottles.
## Bottling
To pull and bottle a pull request with `brew pull`:
diff --git a/docs/Brew-Test-Bot.md b/docs/Brew-Test-Bot.md
index db39327fa..484fa3275 100644
--- a/docs/Brew-Test-Bot.md
+++ b/docs/Brew-Test-Bot.md
@@ -3,9 +3,9 @@
`brew test-bot` is the name for the automated review and testing system funded
by [our Kickstarter in 2013](https://www.kickstarter.com/projects/homebrew/brew-test-bot).
-It comprises of four Mac Minis running in a data centre in England which host
+It comprises four Mac Minis running in a data centre in England which host
[a Jenkins instance at https://bot.brew.sh](https://bot.brew.sh) and run the
-[`brew test-bot.rb`](https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/test-bot.rb)
+[`brew test-bot.rb`](https://github.com/Homebrew/homebrew-test-bot/blob/master/cmd/brew-test-bot.rb)
Ruby script to perform automated testing of commits to the master branch, pull
requests and custom builds requested by maintainers.
@@ -15,7 +15,7 @@ The bot automatically builds pull requests and updates their status depending
on the result of the job.
For example, a job which has been queued but not yet started will have a
-section in the pull-request that looks like this:
+section in the pull request that looks like this:
![Triggered Pull Request](images/brew-test-bot-triggered-pr.png)
diff --git a/docs/Common-Issues.md b/docs/Common-Issues.md
index 8da622ab4..e8b48751d 100644
--- a/docs/Common-Issues.md
+++ b/docs/Common-Issues.md
@@ -7,8 +7,7 @@ You need to have the Xcode Command Line Utilities installed (and updated): run `
(In OS X prior to 10.9, the "Command Line Tools" package can alternatively be installed from within Xcode. `⌘,` will get you to preferences. Visit the "Downloads" tab and hit the install button next to "Command Line Tools".)
### Ruby `bad interpreter: /usr/bin/ruby^M: no such file or directory`
-You cloned with git, and your git configuration is set to use Windows line endings. See this page: https://help.github.com/articles/dealing-with-line-endings
-
+You cloned with git, and your git configuration is set to use Windows line endings. See this page: <https://help.github.com/articles/dealing-with-line-endings>
### Ruby `bad interpreter: /usr/bin/ruby`
You don't have a `/usr/bin/ruby` or it is not executable. It's not recommended to let this persist, you'd be surprised how many .apps, tools and scripts expect your macOS provided files and directories to be *unmodified* since macOS was installed.
diff --git a/docs/External-Commands.md b/docs/External-Commands.md
index 59622bd3a..e2dafdce8 100644
--- a/docs/External-Commands.md
+++ b/docs/External-Commands.md
@@ -47,15 +47,15 @@ brew tap youtux/livecheck
```
### brew-gem
-Install any gem package into a self-contained Homebrew cellar location: [https://github.com/sportngin/brew-gem](https://github.com/sportngin/brew-gem).
+Install any gem package into a self-contained Homebrew cellar location: <https://github.com/sportngin/brew-gem>
Note this can also be installed with `brew install brew-gem`.
### brew-growl
-Get Growl notifications for Homebrew https://github.com/secondplanet/brew-growl
+Get Growl notifications for Homebrew: <https://github.com/secondplanet/homebrew-growl>
### brew-services
-Simple support to start formulae using launchctl, has out of the box support for any formula which defines `startup_plist` (e.g. mysql, postgres, redis u.v.m.): [https://github.com/Homebrew/homebrew-services](https://github.com/Homebrew/homebrew-services)
+Simple support to start formulae using launchctl, has out of the box support for any formula which defines `startup_plist` (e.g. mysql, postgres, redis u.v.m.): <https://github.com/Homebrew/homebrew-services>
Install using:
```sh
diff --git a/docs/FAQ.md b/docs/FAQ.md
index 7a32cf926..7527289dc 100644
--- a/docs/FAQ.md
+++ b/docs/FAQ.md
@@ -81,13 +81,12 @@ including how to set this across reboots. If you’re pre-Mountain Lion,
alternative](https://developer.apple.com/legacy/library/qa/qa1067/_index.html).
## How do I contribute to Homebrew?
-Read [CONTRIBUTING.md](/CONTRIBUTING.md).
+Read [CONTRIBUTING.md](https://github.com/Homebrew/brew/blob/master/CONTRIBUTING.md).
## Why do you compile everything?
Homebrew provides pre-compiled versions for many formulae. These
pre-compiled versions are referred to as **bottles** and are available
-at:
-[https://bintray.com/homebrew/bottles](https://bintray.com/homebrew/bottles).
+at <https://bintray.com/homebrew/bottles>.
If available, bottled binaries will be used by default except under the
following conditions:
diff --git a/docs/Formula-Cookbook.md b/docs/Formula-Cookbook.md
index c87424c7e..6b4678f90 100644
--- a/docs/Formula-Cookbook.md
+++ b/docs/Formula-Cookbook.md
@@ -288,13 +288,13 @@ Name the formula like the project markets the product. So it’s `pkg-config`, n
The only exception is stuff like “Apache Ant”. Apache sticks “Apache” in front of everything, but we use the formula name `ant`. We only include the prefix in cases like *GNUplot* (because it’s part of the name) and *GNU Go* (because everyone calls it “GNU go”—nobody just calls it “Go”). The word “Go” is too common and there are too many implementations of it.
-If you’re not sure about the name check the homepage, and check the Wikipedia page and [what Debian call it](https://www.debian.org/distrib/packages).
+If you’re not sure about the name check the homepage, and check the Wikipedia page and [what Debian calls it](https://www.debian.org/distrib/packages).
-Where Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users’ expectation.
+Where Homebrew already has a formula called `foo` we typically do not accept requests to replace that formula with something else also named `foo`. This is to avoid both confusing and surprising users’ expectations.
When two formulae share an upstream name, e.g. [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt.rb) and [`AESCrypt`](https://github.com/Homebrew/homebrew-core/blob/master/Formula/aescrypt-packetizer.rb) the newer formula must typically adapt the name to avoid conflict with the current formula.
-If you’re *still* not sure, just commit. We’ll apply some arbitrary rule and make a decision :wink:.
+If you’re *still* not sure, just commit. We’ll apply some arbitrary rule and make a decision 😉.
When importing classes, Homebrew will require the formula and then create an instance of the class. It does this by assuming the formula name can be directly converted to the class name using a `regexp`. The rules are simple:
diff --git a/docs/Gems,-Eggs-and-Perl-Modules.md b/docs/Gems,-Eggs-and-Perl-Modules.md
index 770d770f6..f86124f66 100644
--- a/docs/Gems,-Eggs-and-Perl-Modules.md
+++ b/docs/Gems,-Eggs-and-Perl-Modules.md
@@ -81,7 +81,7 @@ or use this:
**However all versions of RubyGems before 1.3.6 are buggy** and ignore
the above setting. Sadly a fresh install of Snow Leopard comes with
-1.3.5. Currently the only known way to get round this is to upgrade
+1.3.5. Currently the only known way to get around this is to upgrade
rubygems as root:
`sudo gem update --system`
diff --git a/docs/Homebrew-and-Python.md b/docs/Homebrew-and-Python.md
index e2f59c322..2e9e643b5 100644
--- a/docs/Homebrew-and-Python.md
+++ b/docs/Homebrew-and-Python.md
@@ -58,7 +58,7 @@ Homebrew builds bindings against the first `python` (and `python-config`) in you
**Warning!** Python may crash (see [Common Issues](Common-Issues.md)) if you `import <module>` from a brewed Python if you ran `brew install <formula_with_python_bindings>` against the system Python. If you decide to switch to the brewed Python, then reinstall all formulae with python bindings (e.g. `pyside`, `wxwidgets`, `pygtk`, `pygobject`, `opencv`, `vtk` and `boost-python`).
## Policy for non-brewed Python bindings
-These should be installed via `pip install <x>`. To discover, you can use `pip search` or <https://pypi.python.org/pypi>. (**Note:** System Python does not provide `pip`. Follow the instructions at https://pip.readthedocs.org/en/stable/installing/#install-pip to install it for your system Python if you would like it.)
+These should be installed via `pip install <x>`. To discover, you can use `pip search` or <https://pypi.python.org/pypi>. (**Note:** System Python does not provide `pip`. Follow the instructions at <https://pip.readthedocs.io/en/stable/installing/#install-pip> to install it for your system Python if you would like it.)
## Brewed Python modules
diff --git a/docs/How-To-Open-a-Homebrew-Pull-Request.md b/docs/How-To-Open-a-Homebrew-Pull-Request.md
index ef6091e2c..104fc2829 100644
--- a/docs/How-To-Open-a-Homebrew-Pull-Request.md
+++ b/docs/How-To-Open-a-Homebrew-Pull-Request.md
@@ -25,7 +25,7 @@ Depending on the change you want to make, you need to send the pull request to t
3. Add your pushable forked repository with `git remote add <YOUR_USERNAME> https://github.com/<YOUR_USERNAME>/homebrew-core.git`
* `<YOUR_USERNAME>` is your GitHub username, not your local machine username.
-For formulae in central taps other than `homebrew/core`, such as `homebrew/science` or `homebrew/games`, substitute that tap's name for `homebrew/core` in each step, and alter the GitHub repository URLs as necessary.
+For formulae in central taps other than `homebrew/core`, such as `homebrew/science` or `homebrew/nginx`, substitute that tap's name for `homebrew/core` in each step, and alter the GitHub repository URLs as necessary.
## Create your pull request from a new branch
@@ -43,7 +43,7 @@ To make a new branch and submit it for review, create a GitHub pull request with
4. `brew audit --strict <CHANGED_FORMULA>`
6. Make a separate commit for each changed formula with `git add` and `git commit`.
7. Upload your new commits to the branch on your fork with `git push --set-upstream <YOUR_USERNAME> <YOUR_BRANCH_NAME>`.
-8. Go to the relevant repository (e.g. https://github.com/Homebrew/brew, https://github.com/Homebrew/homebrew-core, etc.) and create a pull request to request review and merging of the commits in your pushed branch. Explain why the change is needed and, if fixing a bug, how to reproduce the bug. Make sure you have done each step in the checklist that appears in your new PR.
+8. Go to the relevant repository (e.g. <https://github.com/Homebrew/brew>, <https://github.com/Homebrew/homebrew-core>, etc.) and create a pull request to request review and merging of the commits in your pushed branch. Explain why the change is needed and, if fixing a bug, how to reproduce the bug. Make sure you have done each step in the checklist that appears in your new PR.
* Please note that our preferred commit message format for simple version updates is "`<FORMULA_NAME> <NEW_VERSION>`", e.g. "`source-highlight 3.1.8`". `devel` version updates should have the commit message suffixed with `(devel)`, e.g. "`nginx 1.9.1 (devel)`". If updating both stable and `devel`, the format should be a concatenation of these two forms, e.g. "`x264 r2699, r2705 (devel)`".
9. Await feedback or a merge from Homebrew's maintainers. We typically respond to all PRs within a couple days, but it may take up to a week, depending on the maintainers' workload.
10. Thank you!
diff --git a/docs/Interesting-Taps-&-Forks.md b/docs/Interesting-Taps-&-Forks.md
index a5c609441..de9b8809e 100644
--- a/docs/Interesting-Taps-&-Forks.md
+++ b/docs/Interesting-Taps-&-Forks.md
@@ -1,7 +1,7 @@
# Interesting Taps & Forks
A Tap is homebrew-speak for a git repository containing extra formulae.
-Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` command. Type `man brew` in your Terminal. The main repository https://github.com/Homebrew/homebrew-core, often called `homebrew/core`, is always built-in.
+Homebrew has the capability to add (and remove) multiple taps to your local installation with the `brew tap` and `brew untap` command. Type `man brew` in your Terminal. The main repository <https://github.com/Homebrew/homebrew-core>, often called `homebrew/core`, is always built-in.
## Main Taps
diff --git a/docs/Node-for-Formula-Authors.md b/docs/Node-for-Formula-Authors.md
index c78668a58..83516da93 100644
--- a/docs/Node-for-Formula-Authors.md
+++ b/docs/Node-for-Formula-Authors.md
@@ -14,9 +14,9 @@ where `libexec` is the destination prefix (usually the `libexec` variable).
# Download URL
-If the Node module is also available on the npm registry, we prefer npm hosted release tarballs over GitHub (or elsewhere) hosted source tarballs. The advantages of these tarballs are that they doesn't include the files from the `.npmignore` (such as tests) resulting in a smaller download size and that a possibly transpilation step is already done (e.g. no need to compile CoffeeScript files as a build step).
+If the Node module is also available on the npm registry, we prefer npm hosted release tarballs over GitHub (or elsewhere) hosted source tarballs. The advantages of these tarballs are that they don't include the files from the `.npmignore` (such as tests) resulting in a smaller download size and that any possible transpilation step is already done (e.g. no need to compile CoffeeScript files as a build step).
-The npm registry URLs have usually the format of:
+The npm registry URLs usually have the format of:
```
https://registry.npmjs.org/<name>/-/<name>-<version>.tgz
@@ -26,33 +26,33 @@ Alternatively you could curl the JSON at `https://registry.npmjs.org/<name>` and
# Dependencies
-Node modules, which are compatible with the latest Node version should declare a dependencies on the `node` formula.
+Node modules which are compatible with the latest Node version should declare a dependency on the `node` formula.
```ruby
depends_on "node"
```
-If your formula requires to be executed with an older Node version you must vendor this older Node version as done in the [`kibana` formula](https://github.com/Homebrew/homebrew-core/blob/c6202f91a129e2f994d904f299a308cc6fbd58e5/Formula/kibana.rb).
+If your formula requires being executed with an older Node version you must vendor this older Node version as done in the [`kibana` formula](https://github.com/Homebrew/homebrew-core/blob/c6202f91a129e2f994d904f299a308cc6fbd58e5/Formula/kibana.rb).
### Special requirements for native addons
-If your node module is a native addon or has a native addon somewhere in it's dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in a invocation of `node-gyp` we need an additional build time dependency on `:python` (because gyp depends on Python 2.7).
+If your node module is a native addon or has a native addon somewhere in its dependency tree you have to declare an additional dependency. Since the compilation of the native addon results in a invocation of `node-gyp` we need an additional build time dependency on `:python` (because gyp depends on Python 2.7).
```ruby
depends_on :python => :build
```
-Please also note, that such a formula would only be compatible with the same Node major version it originally was compiled with. This means that we need to revision every formula with a Node native addon with every major version bump of the `node` formula. To make sure we don't overlook your formula on a Node major version bump, write a meaningful test which would fail in such a case (invoked with an ABI incompatible Node version).
+Please also note that such a formula would only be compatible with the same Node major version it originally was compiled with. This means that we need to revision every formula with a Node native addon with every major version bump of the `node` formula. To make sure we don't overlook your formula on a Node major version bump, write a meaningful test which would fail in such a case (invoked with an ABI incompatible Node version).
# Installation
Node modules should be installed to `libexec`. This prevents the Node modules from contaminating the global `node_modules`, which is important so that npm doesn't try to manage Homebrew-installed Node modules.
-In the following we distinguish between 2 type of Node module using formulae:
+In the following we distinguish between two types of Node modules using formulae:
* formulae for standard Node modules compatible with npm's global module format which should use [`std_npm_install_args`](#installing-global-style-modules-with-std_npm_install_args-to-libexec) (like [`azure-cli`](https://github.com/Homebrew/homebrew-core/blob/d93fe9ba3bcc9071b699c8da4e7d733518d3337e/Formula/azure-cli.rb) or [`autocode`](https://github.com/Homebrew/homebrew-core/blob/1a670a6269e1e07f86683c2d164977c9bd8a3fb6/Formula/autocode.rb)) and
-* formulae were the `npm install` step is only one of multiple not exclusively Node related install steps (not compatible with npm's global module format) which have to use [`local_npm_install_args`](#installing-module-dependencies-locally-with-local_npm_install_args) (like [`elixirscript`](https://github.com/Homebrew/homebrew-core/blob/ec1e40d37e81af63122a354f0101c377f6a4e66d/Formula/elixirscript.rb) or [`kibana`](https://github.com/Homebrew/homebrew-core/blob/c6202f91a129e2f994d904f299a308cc6fbd58e5/Formula/kibana.rb))
+* formulae where the `npm install` step is only one of multiple not exclusively Node related install steps (not compatible with npm's global module format) which have to use [`local_npm_install_args`](#installing-module-dependencies-locally-with-local_npm_install_args) (like [`elixirscript`](https://github.com/Homebrew/homebrew-core/blob/ec1e40d37e81af63122a354f0101c377f6a4e66d/Formula/elixirscript.rb) or [`kibana`](https://github.com/Homebrew/homebrew-core/blob/c6202f91a129e2f994d904f299a308cc6fbd58e5/Formula/kibana.rb))
-Both methods have in common, that they are setting the correct environment for using npm inside Homebrew up and returning the arguments for invoking `npm install` for their specific use cases. This includes fixing an important edge case with the npm cache (Caused by Homebrew's redirection of `$HOME` during the build and test process) by using our own custom `npm_cache` inside `HOMEBREW_CACHE`, which would otherwise result in very long build times and high disk space usage.
+Both methods have in common that they are setting the correct environment for using npm inside Homebrew and are returning the arguments for invoking `npm install` for their specific use cases. This includes fixing an important edge case with the npm cache (caused by Homebrew's redirection of `$HOME` during the build and test process) by using our own custom `npm_cache` inside `HOMEBREW_CACHE`, which would otherwise result in very long build times and high disk space usage.
To use them you have to require the Node language module at the beginning of your formula file with:
@@ -62,13 +62,13 @@ require "language/node"
### Installing global style modules with `std_npm_install_args` to libexec
-In your formula's `install` method, simply cd to the top level of your Node module if necessary and than use `system` to invoke `npm install` with `Language::Node.std_npm_install_args` like:
+In your formula's `install` method, simply cd to the top level of your Node module if necessary and then use `system` to invoke `npm install` with `Language::Node.std_npm_install_args` like:
```ruby
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
```
-This will install your Node module in npm's global module style with a custom prefix to `libexec`. All your modules executable will be automatically resolved by npm into `libexec/"bin"` for you, which is not symlinked into Homebrew's prefix. We need to make sure these are installed. Do this with we need to symlink all executables to `bin` with:
+This will install your Node module in npm's global module style with a custom prefix to `libexec`. All your modules' executables will be automatically resolved by npm into `libexec/"bin"` for you, which is not symlinked into Homebrew's prefix. We need to make sure these are installed. To do this we need to symlink all executables to `bin` with:
```ruby
bin.install_symlink Dir["#{libexec}/bin/*"]
@@ -76,13 +76,13 @@ bin.install_symlink Dir["#{libexec}/bin/*"]
### Installing module dependencies locally with `local_npm_install_args`
-In your formula's `install` method, do any installation steps which need to be done before the `npm install` step and than cd to the top level of the included Node module. Then, use `system` with `Language::Node.local_npm_install_args` to invoke `npm install` like:
+In your formula's `install` method, do any installation steps which need to be done before the `npm install` step and then cd to the top level of the included Node module. Then, use `system` with `Language::Node.local_npm_install_args` to invoke `npm install` like:
```ruby
system "npm", "install", *Language::Node.local_npm_install_args
```
-This will install all of your Node modules dependencies to your local build path. You can now continue with your build steps and take care of the installation into the Homebrew `prefix` by your own, following the [general Homebrew formula instructions](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md).
+This will install all of your Node modules dependencies to your local build path. You can now continue with your build steps and take care of the installation into the Homebrew `prefix` on your own, following the [general Homebrew formula instructions](https://github.com/Homebrew/brew/blob/master/docs/Formula-Cookbook.md).
# Example
diff --git a/docs/Prose-Style-Guidelines.md b/docs/Prose-Style-Guidelines.md
index 1d8e2b0fc..7da21d355 100644
--- a/docs/Prose-Style-Guidelines.md
+++ b/docs/Prose-Style-Guidelines.md
@@ -44,8 +44,8 @@ We prefer:
* More generally, parallel list item structure
* Capitalize all list items if you want, even if they're not complete sentences; just be consistent within each list, and preferably, throughout the whole page
* Use a subordinate list item instead of dropping a multi-sentence paragraph-long item into a list of sentence fragments
-* Prefer Markdown over other markup formats unless their specific features are needed.
-* GitHub flavored Markdown. GitHub's implementation is the standard, period.
+* Prefer Markdown over other markup formats unless their specific features are needed
+ * GitHub Flavored Markdown. GitHub's implementation is the standard, period.
### Typographical conventions
diff --git a/docs/Python-for-Formula-Authors.md b/docs/Python-for-Formula-Authors.md
index 93830a6c7..0867e8dd8 100644
--- a/docs/Python-for-Formula-Authors.md
+++ b/docs/Python-for-Formula-Authors.md
@@ -4,7 +4,7 @@ This document explains how to successfully use Python in a Homebrew formula.
Homebrew draws a distinction between Python **applications** and Python **libraries**. The difference is that users generally do not care that applications are written in Python; it is unusual that a user would expect to be able to `import foo` after installing an application. Examples of applications are `ansible` and `jrnl`.
-Python libraries exist to be imported from other Python modules; they are often dependencies of Python applications. They are usually no more than incidentally useful from a Terminal.app command line. Examples of libraries are `py2cairo` and the bindings that are installed by `protobuf --with-python`.
+Python libraries exist to be imported by other Python modules; they are often dependencies of Python applications. They are usually no more than incidentally useful from a Terminal.app command line. Examples of libraries are `py2cairo` and the bindings that are installed by `protobuf --with-python`.
Bindings are a special case of libraries that allow Python code to interact with a library or application implemented in another language.
@@ -22,7 +22,7 @@ where `prefix` is the destination prefix (usually `libexec` or `prefix`).
# Python module dependencies
-In general, applications should unconditionally bundle all of their dependencies and libraries should install any unsatisfied dependencies; these strategies are discussed in depth in the following sections.
+In general, applications should unconditionally bundle all of their dependencies and libraries and should install any unsatisfied dependencies; these strategies are discussed in depth in the following sections.
In the rare instance that this proves impractical, you can specify a Python module as an external dependency using the syntax:
@@ -49,9 +49,9 @@ Applications that are compatible with Python 2 **should** use the Apple-provided
```ruby
depends_on :python if MacOS.version <= :snow_leopard
```
-No explicit Python dependency is needed on recent OS versions since /usr/bin is always in `PATH` for Homebrew formulĂŠ; on Leopard and older, the python in `PATH` is used if it's at least version 2.7, or else Homebrew's python is installed.
+No explicit Python dependency is needed on recent OS versions since /usr/bin is always in `PATH` for Homebrew formulae; on Leopard and older, the python in `PATH` is used if it's at least version 2.7, or else Homebrew's python is installed.
-FormulĂŠ for apps that require Python 3 **should** declare an unconditional dependency on `:python3`, which will cause the formula to use the first python3 discovered in `PATH` at install time (or install Homebrew's if there isn't one). These apps **must** work with the current Homebrew python3 formula.
+Formulae for apps that require Python 3 **should** declare an unconditional dependency on `:python3`, which will cause the formula to use the first python3 discovered in `PATH` at install time (or install Homebrew's if there isn't one). These apps **must** work with the current Homebrew python3 formula.
## Installing
@@ -183,7 +183,7 @@ Sometimes we have to `inreplace` a `Makefile` to use our prefix for the python b
Libraries **should** declare a dependency on `:python` or `:python3` as appropriate, which will respectively cause the formula to use the first python or python3 discovered in `PATH` at install time. If a library supports both Python 2.x and Python 3.x, the `:python` dependency **should** be `:recommended` (i.e. built by default) and the :python3 dependency should be `:optional`. Python 2.x libraries **must** function when they are installed against either the system Python or Homebrew Python.
-FormulĂŠ that declare a dependency on `:python` will always be bottled against Homebrew's python, since we cannot in general build binary packages that can be imported from both Pythons. Users can add `--build-from-source` after `brew install` to compile against whichever python is in `PATH`.
+Formulae that declare a dependency on `:python` will always be bottled against Homebrew's python, since we cannot in general build binary packages that can be imported from both Pythons. Users can add `--build-from-source` after `brew install` to compile against whichever python is in `PATH`.
## Installing
@@ -213,7 +213,7 @@ Distribute (not to be confused with distutils) is an obsolete fork of setuptools
## What is `--single-version-externally-managed`?
-`--single-version-externally-managed` ("SVEM") is a setuptools-only [argument to setup.py install](https://pythonhosted.org/setuptools/setuptools.html#install-run-easy-install-or-old-style-installation). The primary effect of SVEM is to use distutils to perform the install instead of using setuptools' `easy_install`.
+`--single-version-externally-managed` ("SVEM") is a setuptools-only [argument to setup.py install](http://setuptools.readthedocs.io/en/latest/setuptools.html?#install-run-easy-install-or-old-style-installation). The primary effect of SVEM is to use distutils to perform the install instead of using setuptools' `easy_install`.
`easy_install` does a few things that we need to avoid:
diff --git a/docs/Querying-Brew.md b/docs/Querying-Brew.md
index 6d37cb588..c5a2d9aeb 100644
--- a/docs/Querying-Brew.md
+++ b/docs/Querying-Brew.md
@@ -31,9 +31,9 @@ The schema itself is not currently documented outside of the code that generates
## Examples
-_The top-level element of the JSON is always an array, so the `map` operator is used to act on the data._
+_The top-level element of the JSON output is always an array, so the `map` operator is used to act on the data._
-### Prety-print a single formula's info
+### Pretty-print a single formula's info
`brew info --json=v1 tig | jq .`
@@ -63,6 +63,6 @@ To find the names of normal (not keg-only) formulae that are installed, but not
## Concluding remarks
-Using the JSON output, queries can be made against Homebrew with less risk of being broken due to Homebrew code changes, and without needing to understand Homebrew's ruby internals.
+Using the JSON output, queries can be made against Homebrew with less risk of being broken due to Homebrew code changes, and without needing to understand Homebrew's Ruby internals.
-If the JSON does not provide some information that it ought to, please submit request, preferably with a patch to add the desired information.
+If the JSON output does not provide some information that it ought to, please submit a request, preferably with a patch to add the desired information.
diff --git a/docs/Tips-N'-Tricks.md b/docs/Tips-N'-Tricks.md
index 8f67c9ca8..e6e18ca9e 100644
--- a/docs/Tips-N'-Tricks.md
+++ b/docs/Tips-N'-Tricks.md
@@ -5,7 +5,7 @@
The supported method of installing specific versions of
some formulae is to see if there is a versions formula like e.g. `gcc@6` available. If the version you’re looking for isn’t available, consider [opening a pull request](How-To-Open-a-Homebrew-Pull-Request.md)!
-### Installing directly from pull-requests
+### Installing directly from pull requests
You can [browse pull requests](https://github.com/Homebrew/homebrew-core/pulls)
and install through the direct link. For example Python 3.3.0 pull request [Homebrew/homebrew#15199](https://github.com/Homebrew/homebrew/pull/15199)
diff --git a/docs/Versions.md b/docs/Versions.md
index bd3ef8a5f..6c6438144 100644
--- a/docs/Versions.md
+++ b/docs/Versions.md
@@ -1,6 +1,6 @@
# Versions
-Now that [Homebrew/versions](https://github.com/homebrew/homebrew-versions) has been deprecated [Homebrew/core](https://github.com/homebrew/homebrew-core) supports multiple versions of formulae with a new naming format.
+Now that [Homebrew/versions](https://github.com/homebrew/homebrew-versions) has been deprecated, [Homebrew/core](https://github.com/homebrew/homebrew-core) supports multiple versions of formulae with a new naming format.
In [Homebrew/versions](https://github.com/homebrew/homebrew-versions) the formula for GCC 6 was named `gcc6.rb` and began `class Gcc6 < Formula`. In [Homebrew/core](https://github.com/homebrew/homebrew-core) this same formula is named `gcc@6.rb` and begins `class GccAT6 < Formula`.
diff --git a/docs/brew-tap.md b/docs/brew-tap.md
index 15f8c7936..cfa0870d8 100644
--- a/docs/brew-tap.md
+++ b/docs/brew-tap.md
@@ -73,7 +73,7 @@ If you need a formula to be installed from a particular tap, you can use fully
qualified names to refer to them.
For example, you can create a tap for an alternative `vim` formula. Without
-pinning it, the behavior will be
+pinning it, the behaviour will be
```bash
brew install vim # installs from homebrew/core