diff options
Diffstat (limited to 'spec/unit/resource/windows_service_spec.rb')
-rw-r--r-- | spec/unit/resource/windows_service_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/unit/resource/windows_service_spec.rb b/spec/unit/resource/windows_service_spec.rb index f5de5b6965..5c4c659844 100644 --- a/spec/unit/resource/windows_service_spec.rb +++ b/spec/unit/resource/windows_service_spec.rb @@ -33,6 +33,29 @@ describe Chef::Resource::WindowsService, "initialize" do expect(resource.resource_name).to eql(:windows_service) end + it "the service_name property is the name_property" do + expect(resource.service_name).to eql("BITS") + end + + it "sets the default action as :nothing" do + expect(resource.action).to eql([:nothing]) + end + + it "supports :enable, :disable, :start, :stop, :restart, :reload, :mask, :unmask, :configure_startup, :create, :delete, :configure actions" do + expect { resource.action :enable }.not_to raise_error + expect { resource.action :disable }.not_to raise_error + expect { resource.action :start }.not_to raise_error + 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 :mask }.not_to raise_error + expect { resource.action :unmask }.not_to raise_error + expect { resource.action :configure_startup }.not_to raise_error + expect { resource.action :create }.not_to raise_error + expect { resource.action :delete }.not_to raise_error + expect { resource.action :configure }.not_to raise_error + end + it "supports setting startup_type" do resource.startup_type(:manual) expect(resource.startup_type).to eql(:manual) |