File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,16 @@ def running(arg=nil)
118118 )
119119 end
120120
121+ def supports ( args = { } )
122+ if args . is_a? Array
123+ args . each { |arg | @supports [ arg ] = true }
124+ elsif args . any?
125+ @supports = args
126+ else
127+ @supports
128+ end
129+ end
130+
121131
122132 end
123133 end
Original file line number Diff line number Diff line change 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
126144end
You can’t perform that action at this time.
0 commit comments