Skip to content

Commit 8cf27d5

Browse files
committed
add some spec tests for service supports
1 parent 286dd24 commit 8cf27d5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

chef/spec/unit/resource/service_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,23 @@
122122
it "should not accept a string for #{attrib}" do
123123
lambda { @resource.send(attrib, "poop") }.should raise_error(ArgumentError)
124124
end
125+
126+
it "should default all the feature support to false" do
127+
support_hash = { :status => false, :restart => false, :reload=> false }
128+
@resource.supports.should eql(support_hash)
129+
end
130+
131+
it "should allow you to set what features this resource supports as a array" do
132+
support_array = [ :status, :restart ]
133+
support_hash = { :status => true, :restart => true, :reload => false }
134+
@resource.supports(support_array)
135+
@resource.supports.should eql(support_hash)
136+
end
137+
138+
it "should allow you to set what features this resource supports as a hash" do
139+
support_hash = { :status => true, :restart => true, :reload => false }
140+
@resource.supports(support_hash)
141+
@resource.supports.should eql(support_hash)
142+
end
125143
end
126144
end

0 commit comments

Comments
 (0)