cli_parser_spec: tweak/fix help output text test,

This commit is contained in:
Mike McQuaid 2019-01-12 19:17:07 +00:00
parent 0a0e2fa0c1
commit b71fcedb43
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

View File

@ -11,8 +11,8 @@ describe Homebrew::CLI::Parser do
}
before do
allow(ENV).to receive(:[])
allow(ENV).to receive(:[]).with("HOMEBREW_PRY").and_return("1")
allow(ENV).to receive(:[]).with("HOMEBREW_VERBOSE")
end
it "parses short option" do
@ -38,12 +38,9 @@ describe Homebrew::CLI::Parser do
expect(Homebrew.args.more_verbose?).to be nil
end
it "raises an exception when an invalid option is passed" do
it "raises an exception and outputs help text when an invalid option is passed" do
expect { parser.parse(["--random"]) }.to raise_error(OptionParser::InvalidOption, /--random/)
end
it "outputs help text on failure" do
expect { parser.parse(["--random"]) }.to raise_error(OptionParser::InvalidOption, /Usage: brew/)
.and output(/Usage: brew/).to_stderr
end
it "maps environment var to an option" do