|
174 | 174 | it "should call the start command if one is specified" do |
175 | 175 | @new_resource.stub!(:start_command).and_return("/etc/init.d/chef startyousillysally") |
176 | 176 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/chef startyousillysally"}).and_return(0) |
177 | | - @provider.start_service(@new_resource.service_name) |
| 177 | + @provider.start_service() |
178 | 178 | end |
179 | 179 |
|
180 | 180 | it "should call '/etc/init.d/service_name start' if no start command is specified" do |
181 | 181 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} start"}).and_return(0) |
182 | | - @provider.start_service(@new_resource.service_name) |
| 182 | + @provider.start_service() |
183 | 183 | end |
184 | 184 | end |
185 | 185 |
|
|
200 | 200 | it "should call the stop command if one is specified" do |
201 | 201 | @new_resource.stub!(:stop_command).and_return("/etc/init.d/chef itoldyoutostop") |
202 | 202 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/chef itoldyoutostop"}).and_return(0) |
203 | | - @provider.stop_service(@new_resource.service_name) |
| 203 | + @provider.stop_service() |
204 | 204 | end |
205 | 205 |
|
206 | 206 | it "should call '/etc/init.d/service_name stop' if no stop command is specified" do |
207 | 207 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} stop"}).and_return(0) |
208 | | - @provider.stop_service(@new_resource.service_name) |
| 208 | + @provider.stop_service() |
209 | 209 | end |
210 | 210 | end |
211 | 211 |
|
|
227 | 227 | it "should call 'restart' on the service_name if the resource supports it" do |
228 | 228 | @new_resource.stub!(:supports).and_return({:restart => true}) |
229 | 229 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} restart"}).and_return(0) |
230 | | - @provider.restart_service(@new_resource.service_name) |
| 230 | + @provider.restart_service() |
231 | 231 | end |
232 | 232 |
|
233 | 233 | it "should call the restart_command if one has been specified" do |
234 | 234 | @new_resource.stub!(:restart_command).and_return("/etc/init.d/chef restartinafire") |
235 | 235 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} restartinafire"}).and_return(0) |
236 | | - @provider.restart_service(@new_resource.service_name) |
| 236 | + @provider.restart_service() |
237 | 237 | end |
238 | 238 |
|
239 | 239 | it "should just call stop, then start when the resource doesn't support restart and no restart_command is specified" do |
240 | | - @provider.should_receive(:stop_service).with(@new_resource.service_name) |
| 240 | + @provider.should_receive(:stop_service) |
241 | 241 | @provider.should_receive(:sleep).with(1) |
242 | | - @provider.should_receive(:start_service).with(@new_resource.service_name) |
243 | | - @provider.restart_service(@new_resource.service_name) |
| 242 | + @provider.should_receive(:start_service) |
| 243 | + @provider.restart_service() |
244 | 244 | end |
245 | 245 | end |
246 | 246 |
|
|
262 | 262 | it "should call 'reload' on the service if it supports it" do |
263 | 263 | @new_resource.stub!(:supports).and_return({:reload => true}) |
264 | 264 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} reload"}).and_return(0) |
265 | | - @provider.reload_service(@new_resource.service_name) |
| 265 | + @provider.reload_service() |
266 | 266 | end |
267 | 267 |
|
268 | 268 | it "should should run the user specified reload command if one is specified and the service doesn't support reload" do |
269 | 269 | @new_resource.stub!(:reload_command).and_return("/etc/init.d/chef lollerpants") |
270 | 270 | @provider.should_receive(:run_command).with({:command => "/etc/init.d/#{@new_resource.service_name} lollerpants"}).and_return(0) |
271 | | - @provider.reload_service(@new_resource.service_name) |
| 271 | + @provider.reload_service() |
272 | 272 | end |
273 | 273 | end |
0 commit comments