chef 17.5.22 → 17.7.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -0
- data/chef.gemspec +1 -0
- data/lib/chef/chef_fs/file_pattern.rb +1 -1
- data/lib/chef/chef_fs/path_utils.rb +1 -1
- data/lib/chef/data_collector/run_end_message.rb +1 -1
- data/lib/chef/dsl/reboot_pending.rb +1 -1
- data/lib/chef/exceptions.rb +10 -0
- data/lib/chef/provider/cron.rb +4 -1
- data/lib/chef/provider/git.rb +1 -1
- data/lib/chef/provider/ifconfig/debian.rb +1 -1
- data/lib/chef/provider/package/habitat.rb +1 -1
- data/lib/chef/provider/subversion.rb +5 -5
- data/lib/chef/resource/archive_file.rb +1 -1
- data/lib/chef/resource/chef_client_trusted_certificate.rb +1 -0
- data/lib/chef/resource/chocolatey_config.rb +1 -1
- data/lib/chef/resource/chocolatey_feature.rb +1 -1
- data/lib/chef/resource/chocolatey_source.rb +24 -2
- data/lib/chef/resource/directory.rb +1 -1
- data/lib/chef/resource/habitat_install.rb +5 -5
- data/lib/chef/resource/inspec_input.rb +7 -8
- data/lib/chef/resource/inspec_waiver.rb +7 -8
- data/lib/chef/resource/inspec_waiver_file_entry.rb +1 -1
- data/lib/chef/resource/kernel_module.rb +27 -2
- data/lib/chef/resource/macos_userdefaults.rb +45 -133
- data/lib/chef/resource/openssl_x509_certificate.rb +1 -1
- data/lib/chef/resource/powershell_package_source.rb +234 -70
- data/lib/chef/resource/windows_auto_run.rb +1 -1
- data/lib/chef/resource/windows_dfs_namespace.rb +2 -2
- data/lib/chef/resource/windows_update_settings.rb +3 -3
- data/lib/chef/resource.rb +1 -1
- data/lib/chef/resource_reporter.rb +1 -1
- data/lib/chef/secret_fetcher/azure_key_vault.rb +62 -8
- data/lib/chef/secret_fetcher.rb +0 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/win32/version.rb +2 -1
- data/spec/functional/dsl/reboot_pending_spec.rb +3 -3
- data/spec/functional/dsl/registry_helper_spec.rb +1 -1
- data/spec/functional/resource/dsc_script_spec.rb +2 -2
- data/spec/functional/resource/macos_userdefaults_spec.rb +119 -0
- data/spec/functional/resource/powershell_package_source_spec.rb +5 -6
- data/spec/functional/resource/registry_spec.rb +81 -81
- data/spec/functional/win32/registry_spec.rb +8 -8
- data/spec/unit/data_collector_spec.rb +24 -1
- data/spec/unit/dsl/reboot_pending_spec.rb +1 -1
- data/spec/unit/mixin/default_paths_spec.rb +1 -1
- data/spec/unit/mixin/securable_spec.rb +3 -3
- data/spec/unit/provider/cron_spec.rb +45 -0
- data/spec/unit/provider/package/rubygems_spec.rb +5 -5
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/registry_key_spec.rb +4 -4
- data/spec/unit/provider/service/windows_spec.rb +5 -5
- data/spec/unit/provider/subversion_spec.rb +4 -4
- data/spec/unit/provider/windows_env_spec.rb +1 -1
- data/spec/unit/provider/zypper_repository_spec.rb +1 -1
- data/spec/unit/resource/chef_client_trusted_certificate_spec.rb +14 -0
- data/spec/unit/resource/chocolatey_config_spec.rb +1 -1
- data/spec/unit/resource/chocolatey_feature_spec.rb +1 -1
- data/spec/unit/resource/chocolatey_source_spec.rb +1 -1
- data/spec/unit/resource/kernel_module_spec.rb +2 -1
- data/spec/unit/resource/macos_user_defaults_spec.rb +36 -96
- data/spec/unit/resource/powershell_package_source_spec.rb +63 -62
- data/spec/unit/resource/registry_key_spec.rb +10 -10
- data/spec/unit/resource/windows_auto_run_spec.rb +1 -1
- data/spec/unit/resource/windows_feature_powershell_spec.rb +1 -1
- data/spec/unit/resource/windows_firewall_rule_spec.rb +2 -2
- data/spec/unit/resource/windows_task_spec.rb +3 -3
- data/spec/unit/resource_reporter_spec.rb +2 -2
- data/spec/unit/resource_spec.rb +5 -0
- data/spec/unit/secret_fetcher/azure_key_vault_spec.rb +99 -20
- data/spec/unit/util/backup_spec.rb +1 -1
- data/spec/unit/win32/registry_spec.rb +3 -3
- 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(
|
507
|
-
allow(File).to receive(:executable?).with(
|
508
|
-
allow(File).to receive(:executable?).with(
|
509
|
-
allow(File).to receive(:executable?).with(
|
510
|
-
allow(File).to receive(:executable?).with(
|
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) {
|
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) {
|
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) {
|
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) {
|
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) {
|
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
|
-
|
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:
|
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:
|
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:
|
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:
|
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) {
|
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(
|
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"] =
|
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"] =
|
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"] =
|
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
|
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(:
|
23
|
-
let(:
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
60
|
-
|
61
|
-
expect(
|
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 "
|
65
|
-
resource.
|
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 "
|
70
|
-
resource.host
|
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 "
|
92
|
-
resource.
|
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 "
|
97
|
-
resource.
|
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
|
-
|
117
|
-
|
118
|
-
expect
|
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 "
|
122
|
-
resource.
|
123
|
-
expect(
|
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
|
-
|
127
|
-
|
128
|
-
expect
|
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 "
|
132
|
-
resource.
|
133
|
-
expect(
|
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
|