Check resources exist before verifying their params

Previously, I was seeing the error
undefined method `parameters' for nil:NilClass in
cases where with_param was specified for resources
that did not exist in the catalog.

This patch will not check the chained params if
the resource does not exist.
This commit is contained in:
Dan Bode 2011-08-03 17:56:53 -07:00
parent b4cf689738
commit 0679654ff4
1 changed files with 1 additions and 1 deletions

View File

@ -15,7 +15,7 @@ module RSpec::Puppet
ret = false
end
if @expected_params
if @expected_params and resources.length != 0
@expected_params.each do |name, value|
unless resources.first.send(:parameters)[name.to_sym] == value
ret = false