aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-23 05:59:26 +0100
committerMarkus Reiter2017-02-23 21:39:23 +0100
commiteeee7127b53eb01fd2cd9d959b3fa9d6743d6af1 (patch)
tree1e78d51670400bbdad664e5a692d417a6dcad60e /Library/Homebrew/test
parentc7121f6be50e44784e3e29114617c29715bd9c0f (diff)
downloadbrew-eeee7127b53eb01fd2cd9d959b3fa9d6743d6af1.tar.bz2
Convert `brew --cellar` test to spec.
Diffstat (limited to 'Library/Homebrew/test')
-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/cmd/--cellar_spec.rb15
3 files changed, 15 insertions, 16 deletions
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/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