]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(maint) Fix failing spec test with Puppet 3.3.0-rc2
authorJeff McCune <jeff@puppetlabs.com>
Thu, 29 Aug 2013 19:54:14 +0000 (12:54 -0700)
committerJeff McCune <jeff@puppetlabs.com>
Thu, 29 Aug 2013 20:02:31 +0000 (13:02 -0700)
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.

spec/functions/ensure_packages_spec.rb

index 1c2a328e4e7407898ea76733de9f2c3bc9740474..6fd56d5c135e9bff00c5093f149a9a342e06714c 100644 (file)
@@ -36,7 +36,7 @@ describe 'ensure_packages' do
     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