forked from Homebrew/homebrew-cask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home_test.rb
44 lines (37 loc) · 992 Bytes
/
home_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
require 'test_helper'
# monkeypatch for testing
class Cask::CLI::Home
def self.system(*command)
system_commands << command
end
def self.reset!
@system_commands = []
end
def self.system_commands
@system_commands ||= []
end
end
describe Cask::CLI::Home do
before do
Cask::CLI::Home.reset!
end
it 'opens the homepage for the specified cask' do
Cask::CLI::Home.run('alfred')
Cask::CLI::Home.system_commands.must_equal [
['/usr/bin/open', '--', 'http://www.alfredapp.com/']
]
end
it 'works for multiple casks' do
Cask::CLI::Home.run('alfred', 'adium')
Cask::CLI::Home.system_commands.must_equal [
['/usr/bin/open', '--', 'http://www.alfredapp.com/'],
['/usr/bin/open', '--', 'https://www.adium.im/']
]
end
it "opens the project page when no cask is specified" do
Cask::CLI::Home.run
Cask::CLI::Home.system_commands.must_equal [
['/usr/bin/open', '--', 'http://caskroom.io/'],
]
end
end