mirror of
https://github.com/donl/homebrew-cask-versions.git
synced 2026-07-18 14:17:07 -06:00
since ln was not using the -h it was following the target symlink destination and deciding it was a destination directory. madness ensued. also test cleanup and more output and change linkables to use sets
39 lines
1.1 KiB
Ruby
39 lines
1.1 KiB
Ruby
require 'test_helper'
|
|
|
|
describe Cask::CLI::Uninstall do
|
|
it "shows an error when a bad cask is provided" do
|
|
TestHelper.must_output(self, lambda {
|
|
Cask::CLI::Uninstall.run('notacask')
|
|
}, 'Error: No available cask for notacask')
|
|
end
|
|
|
|
it "shows an error when a cask is provided that's not installed" do
|
|
TestHelper.must_output(self, lambda {
|
|
Cask::CLI::Uninstall.run('anvil')
|
|
}, 'Error: anvil is not installed')
|
|
end
|
|
|
|
it "can uninstall and unlink multiple casks at once" do
|
|
caffeine = Cask.load('local-caffeine')
|
|
transmission = Cask.load('local-transmission')
|
|
|
|
shutup do
|
|
Cask::Installer.install caffeine
|
|
Cask::AppLinker.new(caffeine).link
|
|
Cask::Installer.install transmission
|
|
Cask::AppLinker.new(transmission).link
|
|
end
|
|
|
|
caffeine.must_be :installed?
|
|
transmission.must_be :installed?
|
|
|
|
shutup do
|
|
Cask::CLI::Uninstall.run('local-caffeine', 'local-transmission')
|
|
end
|
|
|
|
caffeine.wont_be :installed?
|
|
Cask.appdir.join('Transmission.app').wont_be :symlink?
|
|
transmission.wont_be :installed?
|
|
Cask.appdir.join('Caffeine.app').wont_be :symlink?
|
|
end
|
|
end
|