Separate and improve tests

This commit is contained in:
alexbostock 2018-09-17 09:50:02 +01:00
parent a4020db526
commit e733657f04
2 changed files with 11 additions and 3 deletions

View File

@ -8,11 +8,15 @@ describe "brew commands", :integration_test do
.to output(/Built-in commands/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
it "prints a list without headers with the --quiet flag" do
expect { brew "commands", "--quiet" }
.to_not output(/Built-in commands/).to_stdout
expect { brew "commands", "--quiet" }
.to output.to_stdout
.to be_a_success
.and not_to_output.to_stderr
.and be_a_success
end
end

View File

@ -1,14 +1,18 @@
require "cmd/info"
describe "brew info", :integration_test do
it "prints information about a given Formula" do
before do
setup_test_formula "testball"
end
it "prints information about a given Formula" do
expect { brew "info", "testball" }
.to output(/testball: stable 0.1/).to_stdout
.and not_to_output.to_stderr
.and be_a_success
end
it "prints as json with the --json=v1 flag" do
expect { brew "info", "testball", "--json=v1" }
.to output(/\{.+testball.+\}/).to_stdout
.and not_to_output.to_stderr