From dcb85571ca468a573c5ac4f76752ec7e732d9e82 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 14 Jun 2017 13:23:16 +0200 Subject: [PATCH] Add test for `--language` option. --- Library/Homebrew/test/cask/cli_spec.rb | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/test/cask/cli_spec.rb b/Library/Homebrew/test/cask/cli_spec.rb index caa17b0319..51258c5807 100644 --- a/Library/Homebrew/test/cask/cli_spec.rb +++ b/Library/Homebrew/test/cask/cli_spec.rb @@ -1,10 +1,10 @@ describe Hbc::CLI, :cask do it "lists the taps for Casks that show up in two taps" do - listing = Hbc::CLI.nice_listing(%w[ - caskroom/cask/adium - caskroom/cask/google-chrome - passcod/homebrew-cask/adium - ]) + listing = described_class.nice_listing(%w[ + caskroom/cask/adium + caskroom/cask/google-chrome + passcod/homebrew-cask/adium + ]) expect(listing).to eq(%w[ caskroom/cask/adium @@ -13,6 +13,13 @@ describe Hbc::CLI, :cask do ]) end + it "ignores the `--language` option, which is handled in `OS::Mac`" do + cli = described_class.new("--language=en") + expect(cli).to receive(:detect_command_and_arguments).with(no_args) + expect(cli).to receive(:exit).with(1) + shutup { cli.run } + end + context "when no option is specified" do it "--binaries is true by default" do command = Hbc::CLI::Install.new("some-cask") @@ -41,7 +48,7 @@ describe Hbc::CLI, :cask do end it "prints help output when subcommand receives `--help` flag" do - command = Hbc::CLI.new("noop", "--help") + command = described_class.new("noop", "--help") expect(described_class).to receive(:run_command).with("help", "noop") command.run expect(command.help?).to eq(true) @@ -56,7 +63,7 @@ describe Hbc::CLI, :cask do it "exits with a status of 1 when something goes wrong" do allow(described_class).to receive(:lookup_command).and_raise(Hbc::CaskError) - command = Hbc::CLI.new("noop") + command = described_class.new("noop") expect(command).to receive(:exit).with(1) command.run end