diff options
Diffstat (limited to 'Library/Homebrew/test/cask/cli')
| -rw-r--r-- | Library/Homebrew/test/cask/cli/audit_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/cat_spec.rb | 6 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/fetch_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/install_spec.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/style_spec.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/uninstall_spec.rb | 20 | ||||
| -rw-r--r-- | Library/Homebrew/test/cask/cli/zap_spec.rb | 6 |
7 files changed, 22 insertions, 24 deletions
diff --git a/Library/Homebrew/test/cask/cli/audit_spec.rb b/Library/Homebrew/test/cask/cli/audit_spec.rb index 412db1481..01f506c8c 100644 --- a/Library/Homebrew/test/cask/cli/audit_spec.rb +++ b/Library/Homebrew/test/cask/cli/audit_spec.rb @@ -1,5 +1,5 @@ describe Hbc::CLI::Audit, :cask do - let(:cask) { double } + let(:cask) { double("cask", token: nil) } describe "selection of Casks to audit" do it "audits all Casks if no tokens are given" do diff --git a/Library/Homebrew/test/cask/cli/cat_spec.rb b/Library/Homebrew/test/cask/cli/cat_spec.rb index 28089b2f1..b726a0b36 100644 --- a/Library/Homebrew/test/cask/cli/cat_spec.rb +++ b/Library/Homebrew/test/cask/cli/cat_spec.rb @@ -34,9 +34,9 @@ describe Hbc::CLI::Cat, :cask do end it "raises an exception when the Cask does not exist" do - expect { - Hbc::CLI::Cat.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + expect { Hbc::CLI::Cat.run("notacask") } + .to output(/is unavailable/).to_stderr + .and raise_error(Hbc::CaskError, "Cat incomplete.") end describe "when no Cask is specified" do diff --git a/Library/Homebrew/test/cask/cli/fetch_spec.rb b/Library/Homebrew/test/cask/cli/fetch_spec.rb index 9f3056631..54bdfc0c8 100644 --- a/Library/Homebrew/test/cask/cli/fetch_spec.rb +++ b/Library/Homebrew/test/cask/cli/fetch_spec.rb @@ -54,7 +54,7 @@ describe Hbc::CLI::Fetch, :cask do shutup do Hbc::CLI::Fetch.run("notacask") end - }.to raise_error(Hbc::CaskUnavailableError) + }.to raise_error(Hbc::CaskError, "Fetch incomplete.") end describe "when no Cask is specified" do diff --git a/Library/Homebrew/test/cask/cli/install_spec.rb b/Library/Homebrew/test/cask/cli/install_spec.rb index b1b26c867..cf69b5d86 100644 --- a/Library/Homebrew/test/cask/cli/install_spec.rb +++ b/Library/Homebrew/test/cask/cli/install_spec.rb @@ -41,7 +41,7 @@ describe Hbc::CLI::Install, :cask do expect { Hbc::CLI::Install.run("local-transmission") - }.to output(/Warning: A Cask for local-transmission is already installed./).to_stderr + }.to output(/Warning: Cask 'local-transmission' is already installed./).to_stderr end it "allows double install with --force" do @@ -70,7 +70,7 @@ describe Hbc::CLI::Install, :cask do shutup do Hbc::CLI::Install.run("notacask") end - }.to raise_error(Hbc::CaskError) + }.to raise_error(Hbc::CaskError, "Install incomplete.") end it "returns a suggestion for a misspelled Cask" do @@ -80,7 +80,7 @@ describe Hbc::CLI::Install, :cask do rescue Hbc::CaskError nil end - }.to output(/No available Cask for localcaffeine\. Did you mean:\nlocal-caffeine/).to_stderr + }.to output(/Cask 'localcaffeine' is unavailable: No Cask with this name exists\. Did you mean:\nlocal-caffeine/).to_stderr end it "returns multiple suggestions for a Cask fragment" do @@ -90,7 +90,7 @@ describe Hbc::CLI::Install, :cask do rescue Hbc::CaskError nil end - }.to output(/No available Cask for local-caf\. Did you mean one of:\nlocal-caffeine/).to_stderr + }.to output(/Cask 'local-caf' is unavailable: No Cask with this name exists\. Did you mean one of:\nlocal-caffeine/).to_stderr end describe "when no Cask is specified" do diff --git a/Library/Homebrew/test/cask/cli/style_spec.rb b/Library/Homebrew/test/cask/cli/style_spec.rb index a5dcf6f6f..640eca5f4 100644 --- a/Library/Homebrew/test/cask/cli/style_spec.rb +++ b/Library/Homebrew/test/cask/cli/style_spec.rb @@ -107,7 +107,7 @@ describe Hbc::CLI::Style, :cask do end it "tries to find paths for all tokens" do - expect(Hbc::CaskLoader).to receive(:path).twice + expect(Hbc::CaskLoader).to receive(:load).twice.and_return(double("cask", sourcefile_path: nil)) subject end end diff --git a/Library/Homebrew/test/cask/cli/uninstall_spec.rb b/Library/Homebrew/test/cask/cli/uninstall_spec.rb index bc1f52613..cc640fad7 100644 --- a/Library/Homebrew/test/cask/cli/uninstall_spec.rb +++ b/Library/Homebrew/test/cask/cli/uninstall_spec.rb @@ -17,15 +17,15 @@ describe Hbc::CLI::Uninstall, :cask do end it "shows an error when a bad Cask is provided" do - expect { - Hbc::CLI::Uninstall.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + expect { Hbc::CLI::Uninstall.run("notacask") } + .to output(/is unavailable/).to_stderr + .and raise_error(Hbc::CaskError, "Uninstall incomplete.") end it "shows an error when a Cask is provided that's not installed" do - expect { - Hbc::CLI::Uninstall.run("local-caffeine") - }.to raise_error(Hbc::CaskNotInstalledError) + expect { Hbc::CLI::Uninstall.run("local-caffeine") } + .to output(/is not installed/).to_stderr + .and raise_error(Hbc::CaskError, "Uninstall incomplete.") end it "tries anyway on a non-present Cask when --force is given" do @@ -89,11 +89,9 @@ describe Hbc::CLI::Uninstall, :cask do Hbc.appdir.join("MyFancyApp.app").rmtree - expect { - shutup do - Hbc::CLI::Uninstall.run("with-uninstall-script-app") - end - }.to raise_error(Hbc::CaskError, /does not exist/) + expect { shutup { Hbc::CLI::Uninstall.run("with-uninstall-script-app") } } + .to output(/does not exist/).to_stderr + .and raise_error(Hbc::CaskError, "Uninstall incomplete.") expect(cask).to be_installed diff --git a/Library/Homebrew/test/cask/cli/zap_spec.rb b/Library/Homebrew/test/cask/cli/zap_spec.rb index f3af0e66f..e39ca61f8 100644 --- a/Library/Homebrew/test/cask/cli/zap_spec.rb +++ b/Library/Homebrew/test/cask/cli/zap_spec.rb @@ -1,8 +1,8 @@ describe Hbc::CLI::Zap, :cask do it "shows an error when a bad Cask is provided" do - expect { - Hbc::CLI::Zap.run("notacask") - }.to raise_error(Hbc::CaskUnavailableError) + expect { Hbc::CLI::Zap.run("notacask") } + .to output(/is unavailable/).to_stderr + .and raise_error(Hbc::CaskError, "Zap incomplete.") end it "can zap and unlink multiple Casks at once" do |
