summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTor Magnus Rakvåg <tor.magnus@outlook.com>2019-10-07 19:12:03 +0200
committerTor Magnus Rakvåg <tor.magnus@outlook.com>2019-10-07 19:14:09 +0200
commit2f6c1141bba783b1d5ceb1a29397f28c0a7a02c4 (patch)
treeb29e8cb777a19472fcb5021ab0e5c532d3056253 /spec
parent44aa430f4e441f6aa11b6eb422cc413aa3b49e6e (diff)
downloadchef-2f6c1141bba783b1d5ceb1a29397f28c0a7a02c4.tar.gz
unkown profiles should raise a validation error
Signed-off-by: Tor Magnus Rakvåg <tor.magnus@outlook.com>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/resource/windows_firewall_rule_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/resource/windows_firewall_rule_spec.rb b/spec/unit/resource/windows_firewall_rule_spec.rb
index ff6cf776e6..d8d88941c4 100644
--- a/spec/unit/resource/windows_firewall_rule_spec.rb
+++ b/spec/unit/resource/windows_firewall_rule_spec.rb
@@ -152,6 +152,11 @@ describe Chef::Resource::WindowsFirewallRule do
expect(resource.profile).to eql([:notapplicable])
end
+ it "the profile property raises on any unknown values" do
+ expect { resource.profile(:other) }.to raise_error(Chef::Exceptions::ValidationFailed)
+ expect { resource.profile([:public, :other]) }.to raise_error(Chef::Exceptions::ValidationFailed)
+ end
+
it "the profile property coerces strings to symbols" do
resource.profile("Public")
expect(resource.profile).to eql([:public])