aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-02-25 06:51:28 +0100
committerGitHub2017-02-25 06:51:28 +0100
commit9d6962a8e44c111dac1972b63e4a0fa410da42da (patch)
tree2a8cdd06235e56ae7265338c0e3232158e7ec4aa
parent8618aa7dcd97f008d550a6a7ce0719ecb607b445 (diff)
parenteeee7127b53eb01fd2cd9d959b3fa9d6743d6af1 (diff)
downloadbrew-9d6962a8e44c111dac1972b63e4a0fa410da42da.tar.bz2
Merge pull request #2162 from reitermarkus/spec---cellar
Convert `brew --cellar` test to spec.
-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