summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-04-10 14:55:01 -0700
committerGitHub <noreply@github.com>2020-04-10 14:55:01 -0700
commit5a43e8a6a42559119cc99190df1fc8dc1635b721 (patch)
tree33cc1748117597d70b617fdb6f757718cb09f4e3 /spec
parentacd84767df1ec38f5ce5570afd285ecee19802c9 (diff)
downloadchef-5a43e8a6a42559119cc99190df1fc8dc1635b721.tar.gz
Update spec/unit/resource/plist_spec.rb
Signed-off-by: Tim Smith <tsmith@chef.io> Co-Authored-By: pete higgins <pete@peterhiggins.org>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/resource/plist_spec.rb46
1 files changed, 22 insertions, 24 deletions
diff --git a/spec/unit/resource/plist_spec.rb b/spec/unit/resource/plist_spec.rb
index 922aee2fab..a1752811e3 100644
--- a/spec/unit/resource/plist_spec.rb
+++ b/spec/unit/resource/plist_spec.rb
@@ -31,30 +31,28 @@ describe Chef::Resource::Plist do
end
describe "#plistbuddy_command" do
- context "Adding a value to a plist" do
- it "the bool arguments contain the data type" do
- expect(resource.plistbuddy_command(:add, "FooEntry", "path/to/file.plist", true)).to eq "/usr/libexec/PlistBuddy -c 'Add :\"FooEntry\" bool' \"path/to/file.plist\""
- end
-
- it "the add command only adds the data type" do
- expect(resource.plistbuddy_command(:add, "QuuxEntry", "path/to/file.plist", 50)).to eq "/usr/libexec/PlistBuddy -c 'Add :\"QuuxEntry\" integer' \"path/to/file.plist\""
- end
-
- it "the delete command is formatted properly" do
- expect(resource.plistbuddy_command(:delete, "BarEntry", "path/to/file.plist")).to eq "/usr/libexec/PlistBuddy -c 'Delete :\"BarEntry\"' \"path/to/file.plist\""
- end
-
- it "the set command is formatted properly" do
- expect(resource.plistbuddy_command(:set, "BazEntry", "path/to/file.plist", false)).to eq "/usr/libexec/PlistBuddy -c 'Set :\"BazEntry\" false' \"path/to/file.plist\""
- end
-
- it "the print command is formatted properly" do
- expect(resource.plistbuddy_command(:print, "QuxEntry", "path/to/file.plist")).to eq "/usr/libexec/PlistBuddy -c 'Print :\"QuxEntry\"' \"path/to/file.plist\""
- end
-
- it "the command to set a dictionary data type is formatted properly" do
- expect(resource.plistbuddy_command(:set, "AppleFirstWeekday", "path/to/file.plist", gregorian: 4)).to eq "/usr/libexec/PlistBuddy -c 'Set :\"AppleFirstWeekday\":gregorian 4' \"path/to/file.plist\""
- end
+ it "the bool arguments contain the data type" do
+ expect(resource.plistbuddy_command(:add, "FooEntry", "path/to/file.plist", true)).to eq "/usr/libexec/PlistBuddy -c 'Add :\"FooEntry\" bool' \"path/to/file.plist\""
+ end
+
+ it "the add command only adds the data type" do
+ expect(resource.plistbuddy_command(:add, "QuuxEntry", "path/to/file.plist", 50)).to eq "/usr/libexec/PlistBuddy -c 'Add :\"QuuxEntry\" integer' \"path/to/file.plist\""
+ end
+
+ it "the delete command is formatted properly" do
+ expect(resource.plistbuddy_command(:delete, "BarEntry", "path/to/file.plist")).to eq "/usr/libexec/PlistBuddy -c 'Delete :\"BarEntry\"' \"path/to/file.plist\""
+ end
+
+ it "the set command is formatted properly" do
+ expect(resource.plistbuddy_command(:set, "BazEntry", "path/to/file.plist", false)).to eq "/usr/libexec/PlistBuddy -c 'Set :\"BazEntry\" false' \"path/to/file.plist\""
+ end
+
+ it "the print command is formatted properly" do
+ expect(resource.plistbuddy_command(:print, "QuxEntry", "path/to/file.plist")).to eq "/usr/libexec/PlistBuddy -c 'Print :\"QuxEntry\"' \"path/to/file.plist\""
+ end
+
+ it "the command to set a dictionary data type is formatted properly" do
+ expect(resource.plistbuddy_command(:set, "AppleFirstWeekday", "path/to/file.plist", gregorian: 4)).to eq "/usr/libexec/PlistBuddy -c 'Set :\"AppleFirstWeekday\":gregorian 4' \"path/to/file.plist\""
end
it "returns the value properly formatted with double quotes when the value has spaces" do