Without this patch the stdlib spec tests are failing against recent
versions of Puppet. The root cause of this problem is a change in the
behavior of create_resources in Puppet
6baa57b. The change in behavior
caused the :name key to be omitted from the hash returned by
Puppet::Parser::Resource#to_hash which in turn is causing the test
failure.
This patch addresses the problem by updating the test to match the
description of the example. Only the attribute :ensure is checked
instead of the full hash itself.
it 'declares package resources with ensure => present' do
should run.with_params(['facter'])
rsrc = compiler.catalog.resource('Package[facter]')
- rsrc.to_hash.should == {:name => "facter", :ensure => "present"}
+ rsrc.to_hash[:ensure].should eq("present")
end
end
end