(maint) Fix spec failures resulting from Facter API changes
Without this patch stdlib tests fail against Facter 2.x and master but not 1.6.x. This patch fixes the problem by initializing the example group differently depending on the version of Facter integrating into the system. The adjusted methods are: 1.x - Facter.collection.loader.load 2.x - Facter.collection.load The collection actually implements the load method in both version, it's simply marked as private in 1.x.
This commit is contained in:
parent
88af331b0e
commit
97f836f41b
1 changed files with 9 additions and 1 deletions
|
@ -4,8 +4,16 @@ require 'spec_helper'
|
|||
|
||||
describe "PE Version specs" do
|
||||
before :each do
|
||||
# Explicitly load the pe_version.rb file which contains generated facts
|
||||
# that cannot be automatically loaded. Puppet 2.x implements
|
||||
# Facter.collection.load while Facter 1.x markes Facter.collection.load as
|
||||
# a private method.
|
||||
if Facter.collection.respond_to? :load
|
||||
Facter.collection.load(:pe_version)
|
||||
else
|
||||
Facter.collection.loader.load(:pe_version)
|
||||
end
|
||||
end
|
||||
|
||||
context "If PE is installed" do
|
||||
%w{ 2.6.1 2.10.300 }.each do |version|
|
||||
|
|
Loading…
Reference in a new issue