From eeee7127b53eb01fd2cd9d959b3fa9d6743d6af1 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 23 Feb 2017 05:59:26 +0100 Subject: [PATCH] Convert `brew --cellar` test to spec. --- Library/Homebrew/test/cellar_formula_test.rb | 8 -------- Library/Homebrew/test/cellar_test.rb | 8 -------- Library/Homebrew/test/cmd/--cellar_spec.rb | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 Library/Homebrew/test/cellar_formula_test.rb delete mode 100644 Library/Homebrew/test/cellar_test.rb create mode 100644 Library/Homebrew/test/cmd/--cellar_spec.rb diff --git a/Library/Homebrew/test/cellar_formula_test.rb b/Library/Homebrew/test/cellar_formula_test.rb deleted file mode 100644 index 38a934a7ba..0000000000 --- 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 74d5389f81..0000000000 --- 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 0000000000..6c8d7dea69 --- /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