aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 03:33:41 +0100
committerGitHub2017-02-25 03:33:41 +0100
commitd1acb70abc49550b532827e4229e185173fd704c (patch)
tree5908742ed1bd60434fcd7ae520636dd7592f3765 /Library
parent2a36a1e005425acbc7ce13a90c0403f0dee3a706 (diff)
parent201f3abea033bf02b71de6ec907624a600309042 (diff)
downloadbrew-d1acb70abc49550b532827e4229e185173fd704c.tar.bz2
Merge pull request #2150 from reitermarkus/spec---prefix
Convert `brew --prefix` test to spec.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/cmd/--prefix_spec.rb15
-rw-r--r--Library/Homebrew/test/prefix_formula_test.rb8
-rw-r--r--Library/Homebrew/test/prefix_test.rb8
3 files changed, 15 insertions, 16 deletions
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/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