Browse Source
arguments scope linkapps command to just those casks also added unit tests around the CLI code - whee!
phinze
12 years ago
2 changed files with 27 additions and 2 deletions
@ -0,0 +1,24 @@ |
|||||
|
require 'test_helper' |
||||
|
|
||||
|
describe Cask::CLI::Linkapps do |
||||
|
it "only links casks provided in arguments" do |
||||
|
mock_cask = mock() |
||||
|
mock_cask.expects(:linkapps).twice |
||||
|
Cask.expects(:load).with('adium').returns(mock_cask) |
||||
|
|
||||
|
Cask.expects(:load).with('google-chrome').returns(mock_cask) |
||||
|
Cask::CLI::Linkapps.run('adium', 'google-chrome') |
||||
|
end |
||||
|
|
||||
|
it "links all installed casks when no arguments supplied" do |
||||
|
mock_cask = mock() |
||||
|
mock_cask.expects(:linkapps).times(3) |
||||
|
|
||||
|
Cask.expects(:installed).returns(['foo', 'bar', 'baz']) |
||||
|
Cask.expects(:load).with('foo').returns(mock_cask) |
||||
|
Cask.expects(:load).with('bar').returns(mock_cask) |
||||
|
Cask.expects(:load).with('baz').returns(mock_cask) |
||||
|
|
||||
|
Cask::CLI::Linkapps.run |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue