Convert brew --cellar test to spec.

This commit is contained in:
Markus Reiter 2017-02-23 05:59:26 +01:00
parent c7121f6be5
commit eeee7127b5
3 changed files with 15 additions and 16 deletions

View File

@ -1,8 +0,0 @@
require "testing_env"
class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase
def test_cellar_formula
assert_match "#{HOMEBREW_CELLAR}/testball",
cmd("--cellar", testball)
end
end

View File

@ -1,8 +0,0 @@
require "testing_env"
class IntegrationCommandTestCellar < IntegrationCommandTestCase
def test_cellar
assert_equal HOMEBREW_CELLAR.to_s,
cmd("--cellar")
end
end

View File

@ -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