diff options
author | Jacob Zaval <jazava@microsoft.com> | 2022-03-10 13:17:54 -0800 |
---|---|---|
committer | Jacob Zaval <jazava@microsoft.com> | 2022-03-10 13:17:54 -0800 |
commit | 94a99f8e027ea418425682cc5820b202b6e656da (patch) | |
tree | 11dcea9c19ed449b99dc19ec94f5d651ba276e9e /spec | |
parent | f932770f33d1f75e625da7375ab8732e43fdbcd6 (diff) | |
download | chef-94a99f8e027ea418425682cc5820b202b6e656da.tar.gz |
add functional spec for plist, fix hash implementation
Signed-off-by: Jacob Zaval <jazava@microsoft.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/resource/plist_spec.rb | 25 |
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..c8158a8ad6 --- /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.strip.to_i).to eq(4) + end + end +end |