summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-11 10:13:02 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-11 17:15:46 -0700
commit343013ae5bb1dce853407492efb7960ef2cddd3f (patch)
tree178c8cb8fddf9fdf54d9e986de079d13f0e86938
parent8b5e660461118a81802fbe7d93b4939b8092b381 (diff)
downloadchef-343013ae5bb1dce853407492efb7960ef2cddd3f.tar.gz
Add initial unit test
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/resource/windows_uac_spec.rb2
-rw-r--r--spec/unit/resource/windows_user_privilege_spec.rb30
2 files changed, 31 insertions, 1 deletions
diff --git a/spec/unit/resource/windows_uac_spec.rb b/spec/unit/resource/windows_uac_spec.rb
index a82ca65421..48f2f33a16 100644
--- a/spec/unit/resource/windows_uac_spec.rb
+++ b/spec/unit/resource/windows_uac_spec.rb
@@ -44,7 +44,7 @@ describe Chef::Resource::WindowsUac do
expect { resource.consent_behavior_users :bogus }.to raise_error(ArgumentError)
end
- it "sets the default action as :create" do
+ it "sets the default action as :configure" do
expect(resource.action).to eql([:configure])
end
end
diff --git a/spec/unit/resource/windows_user_privilege_spec.rb b/spec/unit/resource/windows_user_privilege_spec.rb
new file mode 100644
index 0000000000..7e1d2e5304
--- /dev/null
+++ b/spec/unit/resource/windows_user_privilege_spec.rb
@@ -0,0 +1,30 @@
+#
+# Copyright:: Copyright (c) Chef Software Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsUserPrivilege do
+ let(:resource) { Chef::Resource::WindowsUserPrivilege.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_user_privilege" do
+ expect(resource.resource_name).to eql(:windows_user_privilege)
+ end
+
+ it "sets the default action as :add" do
+ expect(resource.action).to eql([:add])
+ end
+end