]> gitweb.fluxo.info Git - puppet-stdlib.git/commitdiff
(maint) use puppet's utility function instead of API that's not available on all...
authorDavid Schmitt <david.schmitt@puppetlabs.com>
Thu, 30 Jul 2015 09:46:38 +0000 (10:46 +0100)
committerDavid Schmitt <david.schmitt@puppetlabs.com>
Thu, 30 Jul 2015 09:46:38 +0000 (10:46 +0100)
spec/spec_helper_acceptance.rb

index 6f7f8e11292a52f53747e7c25fa5fbc924d96d94..03ff993ca6209a56e12edde6e9841cb668f05189 100755 (executable)
@@ -1,7 +1,6 @@
 #! /usr/bin/env ruby -S rspec
 require 'beaker-rspec'
 require 'beaker/puppet_install_helper'
-require 'rubygems'
 
 UNSUPPORTED_PLATFORMS = []
 
@@ -37,7 +36,7 @@ end
 RSpec.shared_context "with faked facts" do
   let(:facts_d) do
     puppet_version = (on default, puppet('--version')).output.chomp
-    if Gem::Version(puppet_version) < Gem::Version('4.0.0') && fact('is_pe', '--puppet') == "true"
+    if Puppet::Util::Package.versioncmp(puppet_version, '4.0.0') < 0 && fact('is_pe', '--puppet') == "true"
       if fact('osfamily') =~ /windows/i
         if fact('kernelmajversion').to_f < 6.0
           'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d'