forked from aphyr/salticid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhost.rb
executable file
·51 lines (42 loc) · 937 Bytes
/
host.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
45
46
47
48
49
50
51
#!/usr/bin/env ruby
require 'rubygems'
require 'bacon'
require File.expand_path("#{File.dirname(__FILE__)}/../lib/salticid")
describe "A Host" do
@h = Salticid.new
@h.role :awesome do
task :setup do
'awesome setup'
end
end
@h.role :dreary do
task :setup do
'dreary setup'
end
task :clone do
'a method name!'
end
end
@h.host :localhost do
user ENV['USER']
role :awesome
role :dreary
end
should 'resolve tasks in roles' do
@h.host :localhost do
awesome.setup.should == 'awesome setup'
dreary.setup.should == 'dreary setup'
lambda { setup }.should.raise
end
end
should 'resolve methods which are ordinarily defined as tasks' do
@h.host :localhost do
dreary.clone.should == 'a method name!'
end
end
should '#run' do
@h.host :localhost do
run(:dreary, :clone).should == 'a method name!'
end
end
end