summaryrefslogtreecommitdiff
path: root/spec/unit/property/validation_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/property/validation_spec.rb')
-rw-r--r--spec/unit/property/validation_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/property/validation_spec.rb b/spec/unit/property/validation_spec.rb
index 13afcdfbc2..882ea3353b 100644
--- a/spec/unit/property/validation_spec.rb
+++ b/spec/unit/property/validation_spec.rb
@@ -699,4 +699,13 @@ describe "Chef::Resource.property validation" do
end
end
end
+
+ context "custom validation messages" do
+ with_property ":x, String, validation_message: 'Must be a string, fool'" do
+ it "raise with the correct error message" do
+ expect { resource.x 1 }.to raise_error Chef::Exceptions::ValidationFailed,
+ "Must be a string, fool"
+ end
+ end
+ end
end