summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-24 14:19:01 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-24 14:19:01 -0700
commit69d6fff6f18e4c2d9e60d62853659b855c49b43e (patch)
treeafea7c6c5380ef14b0f0fdbdb0ce4791c21e602e
parentae08a572850f247655674c8a9329566c815ca1d7 (diff)
downloadchef-simpler_windows_timeout.tar.gz
Add specs for the timeout defaultssimpler_windows_timeout
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/resource/service_spec.rb4
-rw-r--r--spec/unit/resource/windows_service_spec.rb9
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/resource/service_spec.rb b/spec/unit/resource/service_spec.rb
index 9bade1698d..a94beece6b 100644
--- a/spec/unit/resource/service_spec.rb
+++ b/spec/unit/resource/service_spec.rb
@@ -145,6 +145,10 @@ describe Chef::Resource::Service do
expect(resource.timeout).to eql(1)
end
+ it "defaults the timeout property to 900 (seconds)" do
+ expect(resource.timeout).to eql(900)
+ end
+
%w{enabled running}.each do |prop|
it "accepts true for #{prop} property" do
resource.send(prop, true)
diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb
index 4f93465b19..1a35e1ad52 100644
--- a/spec/unit/resource/windows_service_spec.rb
+++ b/spec/unit/resource/windows_service_spec.rb
@@ -48,6 +48,15 @@ describe Chef::Resource::WindowsService, "initialize" do
expect { resource.action :unmask }.not_to raise_error
end
+ it "accepts an Integer for timeout property" do
+ resource.timeout 1
+ expect(resource.timeout).to eql(1)
+ end
+
+ it "defaults the timeout property to 60 (seconds)" do
+ expect(resource.timeout).to eql(60)
+ end
+
%i{automatic manual disabled}.each do |type|
it "supports setting startup_type property to #{type.inspect}" do
resource.startup_type type