Convert brew uses test to spec.

This commit is contained in:
Markus Reiter 2017-02-23 06:05:56 +01:00
parent c7121f6be5
commit e7b3cfd516
2 changed files with 25 additions and 16 deletions

View File

@ -0,0 +1,25 @@
describe "brew uses", :integration_test do
it "prints the Formulae a given Formula is used by" do
setup_test_formula "foo"
setup_test_formula "bar"
setup_test_formula "baz", <<-EOS.undent
url "https://example.com/baz-1.0"
depends_on "bar"
EOS
expect { brew "uses", "baz" }
.to be_a_success
.and not_to_output.to_stdout
.and not_to_output.to_stderr
expect { brew "uses", "bar" }
.to output("baz\n").to_stdout
.and not_to_output.to_stderr
.and be_a_success
expect { brew "uses", "--recursive", "foo" }
.to output(/(bar\nbaz|baz\nbar)/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
end

View File

@ -1,16 +0,0 @@
require "testing_env"
class IntegrationCommandTestUses < IntegrationCommandTestCase
def test_uses
setup_test_formula "foo"
setup_test_formula "bar"
setup_test_formula "baz", <<-EOS.undent
url "https://example.com/baz-1.0"
depends_on "bar"
EOS
assert_equal "", cmd("uses", "baz")
assert_equal "baz", cmd("uses", "bar")
assert_match(/(bar\nbaz|baz\nbar)/, cmd("uses", "--recursive", "foo"))
end
end