chef 17.5.22 → 17.7.29

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -0
  3. data/chef.gemspec +1 -0
  4. data/lib/chef/chef_fs/file_pattern.rb +1 -1
  5. data/lib/chef/chef_fs/path_utils.rb +1 -1
  6. data/lib/chef/data_collector/run_end_message.rb +1 -1
  7. data/lib/chef/dsl/reboot_pending.rb +1 -1
  8. data/lib/chef/exceptions.rb +10 -0
  9. data/lib/chef/provider/cron.rb +4 -1
  10. data/lib/chef/provider/git.rb +1 -1
  11. data/lib/chef/provider/ifconfig/debian.rb +1 -1
  12. data/lib/chef/provider/package/habitat.rb +1 -1
  13. data/lib/chef/provider/subversion.rb +5 -5
  14. data/lib/chef/resource/archive_file.rb +1 -1
  15. data/lib/chef/resource/chef_client_trusted_certificate.rb +1 -0
  16. data/lib/chef/resource/chocolatey_config.rb +1 -1
  17. data/lib/chef/resource/chocolatey_feature.rb +1 -1
  18. data/lib/chef/resource/chocolatey_source.rb +24 -2
  19. data/lib/chef/resource/directory.rb +1 -1
  20. data/lib/chef/resource/habitat_install.rb +5 -5
  21. data/lib/chef/resource/inspec_input.rb +7 -8
  22. data/lib/chef/resource/inspec_waiver.rb +7 -8
  23. data/lib/chef/resource/inspec_waiver_file_entry.rb +1 -1
  24. data/lib/chef/resource/kernel_module.rb +27 -2
  25. data/lib/chef/resource/macos_userdefaults.rb +45 -133
  26. data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
  27. data/lib/chef/resource/powershell_package_source.rb +234 -70
  28. data/lib/chef/resource/windows_auto_run.rb +1 -1
  29. data/lib/chef/resource/windows_dfs_namespace.rb +2 -2
  30. data/lib/chef/resource/windows_update_settings.rb +3 -3
  31. data/lib/chef/resource.rb +1 -1
  32. data/lib/chef/resource_reporter.rb +1 -1
  33. data/lib/chef/secret_fetcher/azure_key_vault.rb +62 -8
  34. data/lib/chef/secret_fetcher.rb +0 -1
  35. data/lib/chef/version.rb +1 -1
  36. data/lib/chef/win32/version.rb +2 -1
  37. data/spec/functional/dsl/reboot_pending_spec.rb +3 -3
  38. data/spec/functional/dsl/registry_helper_spec.rb +1 -1
  39. data/spec/functional/resource/dsc_script_spec.rb +2 -2
  40. data/spec/functional/resource/macos_userdefaults_spec.rb +119 -0
  41. data/spec/functional/resource/powershell_package_source_spec.rb +5 -6
  42. data/spec/functional/resource/registry_spec.rb +81 -81
  43. data/spec/functional/win32/registry_spec.rb +8 -8
  44. data/spec/unit/data_collector_spec.rb +24 -1
  45. data/spec/unit/dsl/reboot_pending_spec.rb +1 -1
  46. data/spec/unit/mixin/default_paths_spec.rb +1 -1
  47. data/spec/unit/mixin/securable_spec.rb +3 -3
  48. data/spec/unit/provider/cron_spec.rb +45 -0
  49. data/spec/unit/provider/package/rubygems_spec.rb +5 -5
  50. data/spec/unit/provider/package/windows_spec.rb +1 -1
  51. data/spec/unit/provider/registry_key_spec.rb +4 -4
  52. data/spec/unit/provider/service/windows_spec.rb +5 -5
  53. data/spec/unit/provider/subversion_spec.rb +4 -4
  54. data/spec/unit/provider/windows_env_spec.rb +1 -1
  55. data/spec/unit/provider/zypper_repository_spec.rb +1 -1
  56. data/spec/unit/resource/chef_client_trusted_certificate_spec.rb +14 -0
  57. data/spec/unit/resource/chocolatey_config_spec.rb +1 -1
  58. data/spec/unit/resource/chocolatey_feature_spec.rb +1 -1
  59. data/spec/unit/resource/chocolatey_source_spec.rb +1 -1
  60. data/spec/unit/resource/kernel_module_spec.rb +2 -1
  61. data/spec/unit/resource/macos_user_defaults_spec.rb +36 -96
  62. data/spec/unit/resource/powershell_package_source_spec.rb +63 -62
  63. data/spec/unit/resource/registry_key_spec.rb +10 -10
  64. data/spec/unit/resource/windows_auto_run_spec.rb +1 -1
  65. data/spec/unit/resource/windows_feature_powershell_spec.rb +1 -1
  66. data/spec/unit/resource/windows_firewall_rule_spec.rb +2 -2
  67. data/spec/unit/resource/windows_task_spec.rb +3 -3
  68. data/spec/unit/resource_reporter_spec.rb +2 -2
  69. data/spec/unit/resource_spec.rb +5 -0
  70. data/spec/unit/secret_fetcher/azure_key_vault_spec.rb +99 -20
  71. data/spec/unit/util/backup_spec.rb +1 -1
  72. data/spec/unit/win32/registry_spec.rb +3 -3
  73. metadata +21 -6
@@ -503,11 +503,11 @@ describe Chef::Provider::Package::Rubygems do
503
503
  platform_mock :windows do
504
504
  allow(ENV).to receive(:[]).with("PATH").and_return('C:\windows\system32;C:\windows;C:\Ruby186\bin')
505
505
  allow(ENV).to receive(:[]).with("PATHEXT").and_return(nil)
506
- allow(File).to receive(:executable?).with('C:\\windows\\system32/gem').and_return(false)
507
- allow(File).to receive(:executable?).with('C:\\windows/gem').and_return(false)
508
- allow(File).to receive(:executable?).with('C:\\Ruby186\\bin/gem').and_return(true)
509
- allow(File).to receive(:executable?).with('d:\\opscode\\chef\\bin/gem').and_return(false) # should not get here
510
- allow(File).to receive(:executable?).with('d:\\opscode\\chef\\bin/gem').and_return(false) # should not get here
506
+ allow(File).to receive(:executable?).with("C:\\windows\\system32/gem").and_return(false)
507
+ allow(File).to receive(:executable?).with("C:\\windows/gem").and_return(false)
508
+ allow(File).to receive(:executable?).with("C:\\Ruby186\\bin/gem").and_return(true)
509
+ allow(File).to receive(:executable?).with("d:\\opscode\\chef\\bin/gem").and_return(false) # should not get here
510
+ allow(File).to receive(:executable?).with("d:\\opscode\\chef\\bin/gem").and_return(false) # should not get here
511
511
  allow(File).to receive(:executable?).with("d:/opscode/chef/embedded/bin/gem").and_return(false) # should not get here
512
512
  expect(provider.gem_env.gem_binary_location).to eq('C:\Ruby186\bin/gem')
513
513
  end
@@ -39,7 +39,7 @@ describe Chef::Provider::Package::Windows, :windows_only do
39
39
  new_resource
40
40
  end
41
41
  let(:provider) { Chef::Provider::Package::Windows.new(new_resource, run_context) }
42
- let(:cache_path) { 'c:\\cache\\' }
42
+ let(:cache_path) { "c:\\cache\\" }
43
43
 
44
44
  before(:each) do
45
45
  allow(::File).to receive(:exist?).with(new_resource.source).and_return(true)
@@ -274,7 +274,7 @@ describe Chef::Provider::RegistryKey do
274
274
  end
275
275
 
276
276
  context "when the key data is safe" do
277
- let(:keyname) { 'HKLM\Software\Opscode\Testing\Safe' }
277
+ let(:keyname) { "HKLM\\Software\\Opscode\\Testing\\Safe" }
278
278
  let(:testval1) { { name: "one", type: :string, data: "1" } }
279
279
  let(:testval1_wrong_type) { { name: "one", type: :multi_string, data: "1" } }
280
280
  let(:testval1_wrong_data) { { name: "one", type: :string, data: "2" } }
@@ -295,7 +295,7 @@ describe Chef::Provider::RegistryKey do
295
295
 
296
296
  describe "action_create" do
297
297
  context "when key exists and type matches" do
298
- let(:keyname) { 'hklm\\software\\opscode\\testing\\dword' }
298
+ let(:keyname) { "hklm\\software\\opscode\\testing\\dword" }
299
299
  let(:dword_passed_as_integer) { { name: "one", type: :dword, data: 12345 } }
300
300
  let(:testval1) { { name: "one", type: :dword, data: "12345" } }
301
301
  before do
@@ -349,7 +349,7 @@ describe Chef::Provider::RegistryKey do
349
349
  end
350
350
 
351
351
  context "and key does not exist" do
352
- let(:keyname) { 'hklm\\software\\opscode\\testing\\sensitive\missing' }
352
+ let(:keyname) { "hklm\\software\\opscode\\testing\\sensitive\\missing" }
353
353
  let(:testval1) { { name: "one", type: :string, data: "first_value" } }
354
354
 
355
355
  before(:each) do
@@ -368,7 +368,7 @@ describe Chef::Provider::RegistryKey do
368
368
 
369
369
  describe "action_create_if_missing" do
370
370
  context "when sensitive is true" do
371
- let(:keyname) { 'hklm\\software\\opscode\\testing\\create_if_missing\\sensitive' }
371
+ let(:keyname) { "hklm\\software\\opscode\\testing\\create_if_missing\\sensitive" }
372
372
  let(:testval1) { { name: "one", type: :string, data: "first_value" } }
373
373
 
374
374
  before(:each) do
@@ -33,7 +33,7 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
33
33
 
34
34
  # Actual response from Win32::Service.config_info('chef-client')
35
35
  let(:chef_service_binary_path_name) do
36
- 'C:\\opscode\\chef\\embedded\\bin\\ruby.exe C:\\opscode\\chef\\bin\\chef-windows-service'
36
+ "C:\\opscode\\chef\\embedded\\bin\\ruby.exe C:\\opscode\\chef\\bin\\chef-windows-service"
37
37
  end
38
38
  let(:chef_service_config_info) do
39
39
  double("Struct::ServiceConfigInfo",
@@ -153,11 +153,11 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
153
153
  service_type: "share process",
154
154
  start_type: "demand start",
155
155
  error_control: "normal",
156
- binary_path_name: 'C:\\Windows\\system32\\svchost.exe -k LocalServiceNetworkRestricted',
156
+ binary_path_name: "C:\\Windows\\system32\\svchost.exe -k LocalServiceNetworkRestricted",
157
157
  load_order_group: "TDI",
158
158
  tag_id: 0,
159
159
  dependencies: %w{NSI Tdx Afd},
160
- service_start_name: 'NT Authority\\LocalService',
160
+ service_start_name: "NT Authority\\LocalService",
161
161
  display_name: "DHCP Client")
162
162
  )
163
163
  end
@@ -169,11 +169,11 @@ describe Chef::Provider::Service::Windows, "load_current_resource" do
169
169
  service_type: "share process",
170
170
  start_type: "demand start",
171
171
  error_control: "normal",
172
- binary_path_name: 'C:\\Windows\\system32\\svchost.exe -k LocalServiceNetworkRestricted',
172
+ binary_path_name: "C:\\Windows\\system32\\svchost.exe -k LocalServiceNetworkRestricted",
173
173
  load_order_group: "TDI",
174
174
  tag_id: 0,
175
175
  dependencies: %w{NSI Tdx Afd},
176
- service_start_name: 'NT Authority\\LocalService',
176
+ service_start_name: "NT Authority\\LocalService",
177
177
  display_name: "DHCP Client")
178
178
  )
179
179
  end
@@ -190,7 +190,7 @@ describe Chef::Provider::Subversion do
190
190
  it "runs an export with the --force option" do
191
191
  allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
192
192
  expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
193
- expect(@provider).to receive(:shell_out!).with(expected_cmd, {})
193
+ expect(@provider).to receive(:shell_out!).with(expected_cmd)
194
194
  @provider.run_action(:force_export)
195
195
  expect(@resource).to be_updated
196
196
  end
@@ -198,7 +198,7 @@ describe Chef::Provider::Subversion do
198
198
  it "runs the checkout command for action_checkout" do
199
199
  allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
200
200
  expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
201
- expect(@provider).to receive(:shell_out!).with(expected_cmd, {})
201
+ expect(@provider).to receive(:shell_out!).with(expected_cmd)
202
202
  @provider.run_action(:checkout)
203
203
  expect(@resource).to be_updated
204
204
  end
@@ -248,7 +248,7 @@ describe Chef::Provider::Subversion do
248
248
  allow(@provider).to receive(:find_current_revision).and_return("11410")
249
249
  allow(@provider).to receive(:current_revision_matches_target_revision?).and_return(false)
250
250
  expected_cmd = "svn update -q -r12345 /my/deploy/dir"
251
- expect(@provider).to receive(:shell_out!).with(expected_cmd, {})
251
+ expect(@provider).to receive(:shell_out!).with(expected_cmd)
252
252
  @provider.run_action(:sync)
253
253
  expect(@resource).to be_updated
254
254
  end
@@ -265,7 +265,7 @@ describe Chef::Provider::Subversion do
265
265
  it "runs the export_command on action_export" do
266
266
  allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
267
267
  expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
268
- expect(@provider).to receive(:shell_out!).with(expected_cmd, {})
268
+ expect(@provider).to receive(:shell_out!).with(expected_cmd)
269
269
  @provider.run_action(:export)
270
270
  expect(@resource).to be_updated
271
271
  end
@@ -358,7 +358,7 @@ describe "windows_env provider", :windows_only do
358
358
  context "when environment is PATH" do
359
359
  describe "for PATH" do
360
360
  let(:system_root) { "%SystemRoot%" }
361
- let(:system_root_value) { 'D:\Windows' }
361
+ let(:system_root_value) { "D:\\Windows" }
362
362
  let(:new_resource) do
363
363
  new_resource = Chef::Resource::WindowsEnv.new("PATH", run_context)
364
364
  new_resource.value(system_root)
@@ -103,7 +103,7 @@ describe Chef::Provider::ZypperRepository do
103
103
 
104
104
  describe "#escaped_repo_name" do
105
105
  it "returns an escaped repo name" do
106
- expect(provider.escaped_repo_name).to eq('Nginx\\ Repository')
106
+ expect(provider.escaped_repo_name).to eq("Nginx\\ Repository")
107
107
  end
108
108
  end
109
109
 
@@ -51,4 +51,18 @@ describe Chef::Resource::ChefClientTrustedCertificate do
51
51
  expect(provider.cert_path).to match(%r{trusted_certs/something.pem$})
52
52
  end
53
53
  end
54
+
55
+ describe "sensitive attribute" do
56
+ context "should be insensitive by default" do
57
+ it { expect(resource.sensitive).to(be_falsey) }
58
+ end
59
+
60
+ context "when set" do
61
+ before { resource.sensitive(true) }
62
+
63
+ it "should be set on the resource" do
64
+ expect(resource.sensitive).to(be_truthy)
65
+ end
66
+ end
67
+ end
54
68
  end
@@ -41,7 +41,7 @@ describe Chef::Resource::ChocolateyConfig do
41
41
  # we save off the ENV and set ALLUSERSPROFILE so these specs will work on *nix and non-C drive Windows installs
42
42
  before(:each) do
43
43
  @original_env = ENV.to_hash
44
- ENV["ALLUSERSPROFILE"] = 'C:\ProgramData'
44
+ ENV["ALLUSERSPROFILE"] = "C:\\ProgramData"
45
45
  end
46
46
 
47
47
  after(:each) do
@@ -41,7 +41,7 @@ describe Chef::Resource::ChocolateyFeature do
41
41
  # we save off the ENV and set ALLUSERSPROFILE so these specs will work on *nix and non-C drive Windows installs
42
42
  before(:each) do
43
43
  @original_env = ENV.to_hash
44
- ENV["ALLUSERSPROFILE"] = 'C:\ProgramData'
44
+ ENV["ALLUSERSPROFILE"] = "C:\\ProgramData"
45
45
  end
46
46
 
47
47
  after(:each) do
@@ -54,7 +54,7 @@ describe Chef::Resource::ChocolateySource do
54
54
  allow(resource).to receive(:provider_for_action).and_return(enable_provider)
55
55
  allow(resource.class).to receive(:new).and_return(current_resource)
56
56
  @original_env = ENV.to_hash
57
- ENV["ALLUSERSPROFILE"] = 'C:\ProgramData'
57
+ ENV["ALLUSERSPROFILE"] = "C:\\ProgramData"
58
58
  end
59
59
 
60
60
  after(:each) do
@@ -32,10 +32,11 @@ describe Chef::Resource::KernelModule do
32
32
  expect(resource.modname).to eql("foo")
33
33
  end
34
34
 
35
- it "supports :create and :flush actions" do
35
+ it "supports various actions" do
36
36
  expect { resource.action :install }.not_to raise_error
37
37
  expect { resource.action :uninstall }.not_to raise_error
38
38
  expect { resource.action :blacklist }.not_to raise_error
39
+ expect { resource.action :enable }.not_to raise_error
39
40
  expect { resource.action :disable }.not_to raise_error
40
41
  expect { resource.action :load }.not_to raise_error
41
42
  expect { resource.action :unload }.not_to raise_error
@@ -17,120 +17,60 @@
17
17
 
18
18
  require "spec_helper"
19
19
 
20
- describe Chef::Resource::MacosUserDefaults do
21
-
22
- let(:resource) { Chef::Resource::MacosUserDefaults.new("foo") }
23
- let(:provider) { resource.provider_for_action(:write) }
24
-
25
- it "has a resource name of :macos_userdefaults" do
26
- expect(resource.resource_name).to eq(:macos_userdefaults)
27
- end
28
-
29
- it "the domain property defaults to NSGlobalDomain" do
30
- expect(resource.domain).to eq("NSGlobalDomain")
31
- end
32
-
33
- it "the value property coerces keys in hashes to strings so we can compare them with plist data" do
34
- resource.value "User": "/Library/Managed Installs/way_fake.log"
35
- expect(resource.value).to eq({ "User" => "/Library/Managed Installs/way_fake.log" })
36
- end
37
-
38
- it "the host property defaults to nil" do
39
- expect(resource.host).to be_nil
40
- end
41
-
42
- it "the sudo property defaults to false" do
43
- expect(resource.sudo).to be false
44
- end
45
-
46
- it "sets the default action as :write" do
47
- expect(resource.action).to eq([:write])
48
- end
49
-
50
- it "supports :write action" do
51
- expect { resource.action :write }.not_to raise_error
52
- end
53
-
54
- describe "#defaults_export_cmd" do
55
- it "exports NSGlobalDomain if no domain is set" do
56
- expect(provider.defaults_export_cmd(resource)).to eq(["/usr/bin/defaults", "export", "NSGlobalDomain", "-"])
20
+ describe Chef::Resource::MacosUserDefaults, :macos_only do
21
+ let(:test_value) { "fakest_key_value" }
22
+ let(:test_key) { "fakest_key" }
23
+ let(:node) { Chef::Node.new }
24
+ let(:events) { Chef::EventDispatch::Dispatcher.new }
25
+ let(:run_context) { Chef::RunContext.new(node, {}, events) }
26
+ let(:resource) {
27
+ Chef::Resource::MacosUserDefaults.new("foo", run_context).tap do |r|
28
+ r.value test_value
29
+ r.key test_key
57
30
  end
31
+ }
58
32
 
59
- it "exports a provided domain" do
60
- resource.domain "com.tim"
61
- expect(provider.defaults_export_cmd(resource)).to eq(["/usr/bin/defaults", "export", "com.tim", "-"])
33
+ context "has a default value" do
34
+ it ":macos_userdefaults for resource name" do
35
+ expect(resource.resource_name).to eq(:macos_userdefaults)
62
36
  end
63
37
 
64
- it "sets -currentHost if host is 'current'" do
65
- resource.host "current"
66
- expect(provider.defaults_export_cmd(resource)).to eq(["/usr/bin/defaults", "-currentHost", "export", "NSGlobalDomain", "-"])
38
+ it "NSGlobalDomain for the domain property" do
39
+ expect(resource.domain).to eq("NSGlobalDomain")
67
40
  end
68
41
 
69
- it "sets -host 'tim-laptop if host is 'tim-laptop'" do
70
- resource.host "tim-laptop"
71
- expect(provider.defaults_export_cmd(resource)).to eq(["/usr/bin/defaults", "-host", "tim-laptop", "export", "NSGlobalDomain", "-"])
72
- end
73
- end
74
-
75
- describe "#defaults_modify_cmd" do
76
- # avoid needing to set these required values over and over. We'll overwrite them where necessary
77
- before do
78
- resource.key = "foo"
79
- resource.value = "bar"
80
- end
81
-
82
- it "writes to NSGlobalDomain if domain isn't specified" do
83
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-string", "bar"])
84
- end
85
-
86
- it "uses the domain property if set" do
87
- resource.domain = "MyCustomDomain"
88
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "MyCustomDomain", "foo", "-string", "bar"])
42
+ it "nil for the host property" do
43
+ expect(resource.host).to be_nil
89
44
  end
90
45
 
91
- it "sets host specific values using host property" do
92
- resource.host = "tims_laptop"
93
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "-host", "tims_laptop", "write", "NSGlobalDomain", "foo", "-string", "bar"])
46
+ it "nil for the user property" do
47
+ expect(resource.user).to be_nil
94
48
  end
95
49
 
96
- it "if host is set to :current it passes CurrentHost" do
97
- resource.host = :current
98
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "-currentHost", "write", "NSGlobalDomain", "foo", "-string", "bar"])
99
- end
100
-
101
- it "raises ArgumentError if bool is specified, but the value can't be made into a bool" do
102
- resource.type "bool"
103
- expect { provider.defaults_modify_cmd }.to raise_error(ArgumentError)
104
- end
105
-
106
- it "autodetects array type and passes individual values" do
107
- resource.value = %w{one two three}
108
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-array", "one", "two", "three"])
109
- end
110
-
111
- it "autodetects string type and passes a single value" do
112
- resource.value = "one"
113
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-string", "one"])
50
+ it ":write for resource action" do
51
+ expect(resource.action).to eq([:write])
114
52
  end
53
+ end
115
54
 
116
- it "autodetects integer type and passes a single value" do
117
- resource.value = 1
118
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-int", 1])
55
+ context ":write" do
56
+ it "is a supported action" do
57
+ expect { resource.action :write }.not_to raise_error
119
58
  end
120
59
 
121
- it "autodetects boolean type from TrueClass value and passes a 'TRUE' string" do
122
- resource.value = true
123
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-bool", "TRUE"])
60
+ it "successfully updates the preference" do
61
+ resource.run_action(:write)
62
+ expect(resource.get_preference resource).eql? test_value
124
63
  end
64
+ end
125
65
 
126
- it "autodetects boolean type from FalseClass value and passes a 'FALSE' string" do
127
- resource.value = false
128
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-bool", "FALSE"])
66
+ context ":delete" do
67
+ it "is a supported action" do
68
+ expect { resource.action :delete }.not_to raise_error
129
69
  end
130
70
 
131
- it "autodetects dict type from Hash value and flattens keys & values" do
132
- resource.value = { "foo" => "bar" }
133
- expect(provider.defaults_modify_cmd).to eq(["/usr/bin/defaults", "write", "NSGlobalDomain", "foo", "-dict", "foo", "bar"])
71
+ it "successfully deletes the preference" do
72
+ resource.run_action(:delete)
73
+ expect(resource.get_preference resource).to be_nil
134
74
  end
135
75
  end
136
76
  end