summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-03-29 16:59:12 -0700
committerGitHub <noreply@github.com>2022-03-29 16:59:12 -0700
commita7b347ceb49f66ee5797ae578fbbcc4e45983aee (patch)
treef9de14f6f8ae6c4e0c7b6577e640340c11c13de3 /spec
parentc6177fd7cb1d2910dc470c9d0a85da97481b007c (diff)
parenta04935965f828c3f5b63fe51fe2774f844a90f20 (diff)
downloadchef-a7b347ceb49f66ee5797ae578fbbcc4e45983aee.tar.gz
Merge pull request #12680 from jazaval/plist-file-content
The windows tests were bypassed because they are running on Server 2016 which is deprecated on Github Actions
Diffstat (limited to 'spec')
-rw-r--r--spec/functional/resource/plist_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/functional/resource/plist_spec.rb b/spec/functional/resource/plist_spec.rb
new file mode 100644
index 0000000000..324a01c0c6
--- /dev/null
+++ b/spec/functional/resource/plist_spec.rb
@@ -0,0 +1,25 @@
+require "spec_helper"
+require "plist"
+
+describe Chef::Resource::PlistResource, :macos_only, requires_root: true do
+ include RecipeDSLHelper
+
+ let(:global_prefs) do
+ File.join(Dir.mktmpdir, ".GlobalPreferences.plist")
+ end
+
+ before(:each) do
+ FileUtils.rm_f global_prefs
+ end
+
+ context "make Monday the first DOW" do
+ it "creates a new plist with a hash value" do
+ plist global_prefs do
+ entry "AppleFirstWeekday"
+ value(gregorian: 4)
+ end
+ expect(File.exist?(global_prefs))
+ expect(shell_out!("/usr/libexec/PlistBuddy -c 'Print :\"AppleFirstWeekday\":gregorian' \"#{global_prefs}\"").stdout.to_i).to eq(4)
+ end
+ end
+end