summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2017-08-13 16:34:53 -0700
committerNoah Kantrowitz <noah@coderanger.net>2017-08-13 16:34:53 -0700
commitf4d2315665aaadc367ab007495828a433328c618 (patch)
tree2bcaf12cdd43e1e149fd1424617f5efa9dc7e1d6 /spec
parent3435382c886f95c022ebcced8fa48c478c6269ec (diff)
downloadchef-f4d2315665aaadc367ab007495828a433328c618.tar.gz
Ignore validation errors in Resource#to_text.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/resource_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/resource_spec.rb b/spec/unit/resource_spec.rb
index 6285bad50a..fe41486cf0 100644
--- a/spec/unit/resource_spec.rb
+++ b/spec/unit/resource_spec.rb
@@ -377,6 +377,14 @@ describe Chef::Resource do
expect(resource.to_text).to match(/foo "\*sensitive value suppressed\*"/)
end
end
+
+ context "when property is required" do
+ it "supresses that properties value" do
+ resource_class = Class.new(Chef::Resource) { property :foo, String, required: true }
+ resource = resource_class.new("sensitive_property_tests")
+ expect { resource.to_text }.to_not raise_error Chef::Exceptions::ValidationFailed
+ end
+ end
end
describe "self.resource_name" do