From e733657f046d79b4be94ab006428174b917ec216 Mon Sep 17 00:00:00 2001 From: alexbostock Date: Mon, 17 Sep 2018 09:50:02 +0100 Subject: [PATCH] Separate and improve tests --- Library/Homebrew/test/cmd/commands_spec.rb | 8 ++++++-- Library/Homebrew/test/cmd/info_spec.rb | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/test/cmd/commands_spec.rb b/Library/Homebrew/test/cmd/commands_spec.rb index ab3dd1bce9..c1407798bb 100644 --- a/Library/Homebrew/test/cmd/commands_spec.rb +++ b/Library/Homebrew/test/cmd/commands_spec.rb @@ -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 diff --git a/Library/Homebrew/test/cmd/info_spec.rb b/Library/Homebrew/test/cmd/info_spec.rb index be8912c0a0..1822aab1b4 100644 --- a/Library/Homebrew/test/cmd/info_spec.rb +++ b/Library/Homebrew/test/cmd/info_spec.rb @@ -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