diff options
| author | Markus Reiter | 2017-05-21 02:32:46 +0200 |
|---|---|---|
| committer | Markus Reiter | 2017-05-22 02:51:17 +0200 |
| commit | 02a1e2781fcb808b731fd04d18369ec5bfd3bc68 (patch) | |
| tree | 8328ec31ac14351eeb8a231f4b932bc9f8221468 /Library/Homebrew/test/cask/cli/create_spec.rb | |
| parent | df1864ee435c1c48f87344800d2e7cf055a12f93 (diff) | |
| download | brew-02a1e2781fcb808b731fd04d18369ec5bfd3bc68.tar.bz2 | |
Fix tests for `CLI::Options` DSL.
Diffstat (limited to 'Library/Homebrew/test/cask/cli/create_spec.rb')
| -rw-r--r-- | Library/Homebrew/test/cask/cli/create_spec.rb | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Library/Homebrew/test/cask/cli/create_spec.rb b/Library/Homebrew/test/cask/cli/create_spec.rb index ef6944c32..d77b0a2aa 100644 --- a/Library/Homebrew/test/cask/cli/create_spec.rb +++ b/Library/Homebrew/test/cask/cli/create_spec.rb @@ -36,16 +36,10 @@ describe Hbc::CLI::Create, :cask do EOS end - it "throws away additional Cask arguments and uses the first" do - command = described_class.new("additional-cask", "another-cask") - expect(command).to receive(:exec_editor).with(Hbc::CaskLoader.path("additional-cask")) - command.run - end - - it "throws away stray options" do - command = described_class.new("--notavalidoption", "yet-another-cask") - expect(command).to receive(:exec_editor).with(Hbc::CaskLoader.path("yet-another-cask")) - command.run + it "raises an exception when more than one Cask is given" do + expect { + described_class.run("additional-cask", "another-cask") + }.to raise_error(/Only one Cask can be created at a time./) end it "raises an exception when the Cask already exists" do @@ -68,11 +62,17 @@ describe Hbc::CLI::Create, :cask do end end - describe "when no Cask is specified, but an invalid option" do - it "raises an exception" do + context "when an invalid option is specified" do + it "raises an exception when no Cask is specified" do expect { described_class.run("--notavalidoption") - }.to raise_error(Hbc::CaskUnspecifiedError) + }.to raise_error(/invalid option/) + end + + it "raises an exception" do + expect { + described_class.run("--notavalidoption", "yet-another-cask") + }.to raise_error(/invalid option/) end end end |
