Convert brew --prefix test to spec.

This commit is contained in:
Markus Reiter 2017-02-23 06:01:53 +01:00
parent 0c0a77030e
commit 201f3abea0
3 changed files with 15 additions and 16 deletions

View File

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

View File

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

View File

@ -1,8 +0,0 @@
require "testing_env"
class IntegrationCommandTestPrefix < IntegrationCommandTestCase
def test_prefix
assert_equal HOMEBREW_PREFIX.to_s,
cmd("--prefix")
end
end