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 10:13:02 -0700
commit9be53025a80b1fca8365abe612341ae811778155 (patch)
treedd9866889dea220d0a0e9530e6107dc41df807c7
parent1f147b43fa93d716c52a6d4c7cca07e7beedd925 (diff)
downloadchef-9be53025a80b1fca8365abe612341ae811778155.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