Please review pull request #483: Facter 1.5.7 compatibility in the test condition. opened by (daniel-pittman)

Description:

The augeasversion fact was only introduced in Facter 1.6.1, and this test
depends on it - or blows up trying to process nil in versioncmp.

If we don't have the fact we might as well skip over the test set; it isn't
much worse than working harder at this, and less false positives than guessing
the other way around.

Signed-off-by: Daniel Pittman [email protected]

  • Opened: Fri Feb 10 00:47:08 UTC 2012
  • Based on: puppetlabs:master (19404f2034d37a3fc941b8473f19a2cd3255c0e7)
  • Requested merge: daniel-pittman:maint/master/facter-1.5.7-compatibility-in-test (694394efd86f62680cb1f0d36a490ff5bf5df39d)

Diff follows:

diff --git a/spec/unit/provider/augeas/augeas_spec.rb b/spec/unit/provider/augeas/augeas_spec.rb
index 187730b..e44972b 100755
--- a/spec/unit/provider/augeas/augeas_spec.rb
+++ b/spec/unit/provider/augeas/augeas_spec.rb
@@ -611,7 +611,7 @@
     end
 
     # Optimisations added for Augeas 0.8.2 or higher is available, see #7285
-    describe ">= 0.8.2 optimisations", :if => Puppet.features.augeas? && Puppet::Util::Package.versioncmp(Facter.value(:augeasversion), "0.8.2") >= 0 do
+    describe ">= 0.8.2 optimisations", :if => Puppet.features.augeas? && Facter.value(:augeasversion) && Puppet::Util::Package.versioncmp(Facter.value(:augeasversion), "0.8.2") >= 0 do
       it "should only load one file if relevant context given" do
         @resource[:context] = "/files/etc/fstab"
 

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to