diff options
Diffstat (limited to 'spec/unit/resource/systemd_unit_spec.rb')
-rw-r--r-- | spec/unit/resource/systemd_unit_spec.rb | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/spec/unit/resource/systemd_unit_spec.rb b/spec/unit/resource/systemd_unit_spec.rb index 9d156402a1..e9e0192f91 100644 --- a/spec/unit/resource/systemd_unit_spec.rb +++ b/spec/unit/resource/systemd_unit_spec.rb @@ -35,15 +35,15 @@ describe Chef::Resource::SystemdUnit do } end - it "has a name property" do - expect(resource.name).to eql("sysstat-collect.timer") + it "the unit_name property is the name_property" do + expect(resource.unit_name).to eql("sysstat-collect.timer") end - it "has a default action of nothing" do + it "sets the default action as :nothing" do expect(resource.action).to eql([:nothing]) end - it "supports appropriate unit actions" do + it "supports :create, :delete, :preset, :revert, :enable, :disable, :reenable, :mask, :unmask, :start, :stop, :restart, :reload, :try_restart, :reload_or_restart, :reload_or_try_restart actions" do expect { resource.action :create }.not_to raise_error expect { resource.action :delete }.not_to raise_error expect { resource.action :preset }.not_to raise_error @@ -57,7 +57,9 @@ describe Chef::Resource::SystemdUnit do expect { resource.action :stop }.not_to raise_error expect { resource.action :restart }.not_to raise_error expect { resource.action :reload }.not_to raise_error - expect { resource.action :wrong }.to raise_error(ArgumentError) + expect { resource.action :try_restart }.not_to raise_error + expect { resource.action :reload_or_restart }.not_to raise_error + expect { resource.action :reload_or_try_restart }.not_to raise_error end it "accepts boolean state properties" do |