diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2016-03-15 11:17:02 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2016-03-15 11:17:02 -0700 |
commit | 599b15c22a6a0c1f3125f901c075fb6d013f6307 (patch) | |
tree | 98c5104edb7c75b729f01692c703f0a9039c92e6 | |
parent | c4f145b7e7ba9f6c1fb229c7c96ebe3d17d2aa01 (diff) | |
download | chef-599b15c22a6a0c1f3125f901c075fb6d013f6307.tar.gz |
Improved test coverage for behavior with *_command.
-rw-r--r-- | spec/unit/provider/service/redhat_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/provider/service/redhat_spec.rb b/spec/unit/provider/service/redhat_spec.rb index 9b878abcd6..40f9bc3a91 100644 --- a/spec/unit/provider/service/redhat_spec.rb +++ b/spec/unit/provider/service/redhat_spec.rb @@ -157,6 +157,20 @@ describe "Chef::Provider::Service::Redhat" do end end + %w{start reload restart}.each do |action| + it "should not raise an error when the action is #{action} and init_command is set" do + @new_resource.init_command("/etc/init.d/chef") + @provider.action = action + expect { @provider.process_resource_requirements }.not_to raise_error + end + + it "should not raise an error when the action is #{action} and #{action}_command is set" do + @new_resource.send("#{action}_command", "/etc/init.d/chef #{action}") + @provider.action = action + expect { @provider.process_resource_requirements }.not_to raise_error + end + end + %w{stop disable}.each do |action| it "should not raise an error when the action is #{action}" do @provider.action = action |