diff options
author | John Keiser <john@johnkeiser.com> | 2015-06-04 10:27:26 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-06-23 15:23:02 -0700 |
commit | 2d7f1282c63ca6480f363603608e9d3cdf38116e (patch) | |
tree | ad00eb51bf0fd996d3e6e375b2ebdad9bcb20a70 /spec | |
parent | 6e4783f4e71681c7a6fefedde3e71fd60b1488a3 (diff) | |
download | chef-2d7f1282c63ca6480f363603608e9d3cdf38116e.tar.gz |
Ensure validators don't run against initial values
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/property/validation_spec.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/spec/unit/property/validation_spec.rb b/spec/unit/property/validation_spec.rb index d37d23b437..14be7dc271 100644 --- a/spec/unit/property/validation_spec.rb +++ b/spec/unit/property/validation_spec.rb @@ -74,6 +74,9 @@ describe "Chef::Resource.property validation" do def self.validation_test(validation, success_values, failure_values, getter_values=[], *tags) with_property ":x, #{validation}", *tags do + it "gets nil when retrieving the initial (non-set) value" do + expect(resource.x).to be_nil + end success_values.each do |v| it "value #{v.inspect} is valid" do resource.instance_eval { @x = 'default' } |