Skip to content
Snippets Groups Projects
Commit 53ec50af authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #2127 from reitermarkus/spec-uses

Convert `brew uses` test to spec.
parents e393fd5a e7b3cfd5
No related branches found
No related tags found
No related merge requests found
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
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment