You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
753 B

require 'test_helper'
describe Cask::CLI::Uninstall do
it "shows an error when a bad cask is provided" do
lambda {
Cask::CLI::Uninstall.run('notacask')
}.must_output <<-OUTPUT.gsub(/^ */, '')
Error: No available cask for notacask
OUTPUT
end
it "shows an error when a cask is provided that's not installed" do
lambda {
Cask::CLI::Uninstall.run('anvil')
}.must_output <<-OUTPUT.gsub(/^ */, '')
Error: anvil is not installed
OUTPUT
end
it "delegates to the installer to properly uninstall" do
fake_cask = stub('fake-cask')
Cask.stubs(:load).with('fake-cask').returns(fake_cask)
Cask::Installer.expects(:uninstall).with(fake_cask)
Cask::CLI::Uninstall.run('fake-cask')
end
end