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:
parent
b4cf689738
commit
0679654ff4
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue