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.
42 lines
765 B
42 lines
765 B
12 years ago
|
require 'test_helper'
|
||
|
|
||
|
module RecordSystemCalls
|
||
|
def system(*command)
|
||
|
system_commands << command
|
||
|
end
|
||
|
|
||
|
def reset!
|
||
|
@system_commands = []
|
||
|
end
|
||
|
|
||
|
def system_commands
|
||
|
@system_commands ||= []
|
||
|
end
|
||
|
end
|
||
|
|
||
12 years ago
|
module Cask::CLI::Home
|
||
12 years ago
|
extend RecordSystemCalls
|
||
|
end
|
||
|
|
||
12 years ago
|
describe Cask::CLI::Home do
|
||
12 years ago
|
before do
|
||
12 years ago
|
Cask::CLI::Home.reset!
|
||
12 years ago
|
end
|
||
|
|
||
|
it 'opens the homepage for the specified cask' do
|
||
12 years ago
|
Cask::CLI::Home.run('alfred')
|
||
|
Cask::CLI::Home.system_commands.must_equal [
|
||
12 years ago
|
['open', 'http://www.alfredapp.com/']
|
||
|
]
|
||
|
end
|
||
|
|
||
|
it 'works for multiple casks' do
|
||
12 years ago
|
Cask::CLI::Home.run('alfred', 'adium')
|
||
|
Cask::CLI::Home.system_commands.must_equal [
|
||
12 years ago
|
['open', 'http://www.alfredapp.com/'],
|
||
|
['open', 'http://www.adium.im/']
|
||
|
]
|
||
|
end
|
||
|
end
|
||
|
|