diff options
Diffstat (limited to 'spec/unit/resource/chef_client_systemd_timer_spec.rb')
-rw-r--r-- | spec/unit/resource/chef_client_systemd_timer_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/unit/resource/chef_client_systemd_timer_spec.rb b/spec/unit/resource/chef_client_systemd_timer_spec.rb index dfe01973fb..bb118ea3f3 100644 --- a/spec/unit/resource/chef_client_systemd_timer_spec.rb +++ b/spec/unit/resource/chef_client_systemd_timer_spec.rb @@ -48,6 +48,20 @@ describe Chef::Resource::ChefClientSystemdTimer do expect { resource.action :remove }.not_to raise_error end + it "coerces splay to an Integer" do + resource.splay "10" + expect(resource.splay).to eql(10) + end + + it "raises an error if splay is not a positive number" do + expect { resource.splay("-10") }.to raise_error(Chef::Exceptions::ValidationFailed) + end + + it "set splay to 0" do + resource.splay "0" + expect(resource.splay).to eql(0) + end + describe "#chef_client_cmd" do let(:root_path) { windows? ? "C:\\chef/client.rb" : "/etc/chef/client.rb" } @@ -105,4 +119,4 @@ describe Chef::Resource::ChefClientSystemdTimer do expect(provider.service_content["Service"]["CPUQuota"]).to eq(50) end end -end
\ No newline at end of file +end |