aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Dunn2016-03-16 10:01:43 -0700
committerXu Cheng2016-03-19 19:14:50 +0800
commit90246be60a6ba46e07b5ab65ced53b1290b98ab9 (patch)
tree4aa10618ea25a9a88405e5de96ad3030e30deda2
parent90774be2eebeb7771e4734d7313458c0dbf61124 (diff)
downloadbrew-90246be60a6ba46e07b5ab65ced53b1290b98ab9.tar.bz2
Formula Cookbook: note $HOME override
See https://github.com/Homebrew/homebrew/pull/50130#discussion_r56254860
-rw-r--r--share/doc/homebrew/Formula-Cookbook.md10
1 files changed, 9 insertions, 1 deletions
diff --git a/share/doc/homebrew/Formula-Cookbook.md b/share/doc/homebrew/Formula-Cookbook.md
index 3f9576600..90699f34e 100644
--- a/share/doc/homebrew/Formula-Cookbook.md
+++ b/share/doc/homebrew/Formula-Cookbook.md
@@ -241,7 +241,15 @@ Check the top of the e.g. `./configure` output. Some configure scripts do not re
Please add a [`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#test-class_method) block to the formula. This will be run by `brew test foo` and the [Brew Test Bot](Brew-Test-Bot.md).
-The [`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#test-class_method) block automatically creates and changes to a temporary directory which is deleted after run. You can access this [`Pathname`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Pathname) with the [`testpath`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#testpath-instance_method) function.
+The
+[`test do`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#test-class_method)
+block automatically creates and changes to a temporary directory which
+is deleted after run. You can access this
+[`Pathname`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Pathname)
+with the
+[`testpath`](http://www.rubydoc.info/github/Homebrew/homebrew/master/Formula#testpath-instance_method)
+function. The environment variable `HOME` is set to `testpath` within
+the `test do` block.
We want tests that don't require any user input and test the basic functionality of the application. For example `foo build-foo input.foo` is a good test and (despite their widespread use) `foo --version` and `foo --help` are bad tests. However, a bad test is better than no test at all.