From 7520f3d36d2c8029c6c2996dd9289e9f74b9e6d3 Mon Sep 17 00:00:00 2001 From: John Keiser Date: Fri, 18 Dec 2015 14:48:45 -0800 Subject: Fix nil with properties: 1. Warn when default values are invalid. 2. Never validate nil (on set or get) if there is no default. 3. Emit "will be invalid in Chef 13" warning when setting an invalid nil value. --- spec/unit/resource_reporter_spec.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec/unit/resource_reporter_spec.rb') diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index aa162fd161..3dcd51deab 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -271,6 +271,7 @@ describe Chef::ResourceReporter do @bad_resource = Chef::Resource::File.new("/tmp/nameless_file.txt") allow(@bad_resource).to receive(:name).and_return(nil) allow(@bad_resource).to receive(:identity).and_return(nil) + allow(@bad_resource).to receive(:path).and_return(nil) @resource_reporter.resource_action_start(@bad_resource, :create) @resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource) @resource_reporter.resource_updated(@bad_resource, :create) @@ -294,6 +295,7 @@ describe Chef::ResourceReporter do @bad_resource = Chef::Resource::File.new("/tmp/filename_as_hash.txt") allow(@bad_resource).to receive(:name).and_return({:foo=>:bar}) allow(@bad_resource).to receive(:identity).and_return({:foo=>:bar}) + allow(@bad_resource).to receive(:path).and_return({:foo=>:bar}) @resource_reporter.resource_action_start(@bad_resource, :create) @resource_reporter.resource_current_state_loaded(@bad_resource, :create, @current_resource) @resource_reporter.resource_updated(@bad_resource, :create) -- cgit v1.2.1