diff options
author | Claire McQuin <mcquin@users.noreply.github.com> | 2014-06-18 15:50:54 -0700 |
---|---|---|
committer | Claire McQuin <mcquin@users.noreply.github.com> | 2014-06-18 15:50:54 -0700 |
commit | aa3378a28a4135ea75198c5872989c50550cfdbd (patch) | |
tree | 6d06e5e96c489cae60f6b1ca5f19400e677cf165 /spec/unit/resource/service_spec.rb | |
parent | d8592902ae09980552f8dd57abe9ed9c76851445 (diff) | |
parent | 706a748404107eff715b3cea16d47e89da648886 (diff) | |
download | chef-aa3378a28a4135ea75198c5872989c50550cfdbd.tar.gz |
Merge pull request #506 from ctennis/CHEF-3637
[CHEF-3637] Add support for automatically using the Systemd service provider
Diffstat (limited to 'spec/unit/resource/service_spec.rb')
-rw-r--r-- | spec/unit/resource/service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb index 067fa7d0d3..ec62d012bb 100644 --- a/spec/unit/resource/service_spec.rb +++ b/spec/unit/resource/service_spec.rb @@ -29,6 +29,20 @@ describe Chef::Resource::Service do @resource.should be_a_kind_of(Chef::Resource) @resource.should be_a_kind_of(Chef::Resource::Service) end + + it "should not set a provider unless node[:init_package] is defined as systemd" do + @resource.provider.should == nil + end + + it "should set the provider to Chef::Provider::Service::Systemd if node[:init_package] is systemd" do + node = Chef::Node.new + node.set[:init_package] = "systemd" + cookbook_collection = Chef::CookbookCollection.new([]) + events = Chef::EventDispatch::Dispatcher.new + run_context = Chef::RunContext.new(node, cookbook_collection, events) + @resource = Chef::Resource::Service.new("chef", run_context) + @resource.provider.should == Chef::Provider::Service::Systemd + end it "should set the service_name to the first argument to new" do @resource.service_name.should eql("chef") |