Merge "Fix osnailyfacter tests under puppet4"

This commit is contained in:
Jenkins 2016-03-29 16:46:21 +00:00 committed by Gerrit Code Review
commit 6df3c16dc5
6 changed files with 13 additions and 24 deletions

View File

@ -5,11 +5,7 @@ describe 'function for formating allocation pools for neutron subnet resource' d
def setup_scope
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("floppy", :environment => 'production'))
if Puppet.version =~ /^3\./
@scope = Puppet::Parser::Scope.new(@compiler)
else
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
end
@scope = Puppet::Parser::Scope.new(@compiler)
@topscope = @topscope
@scope.parent = @topscope
Puppet::Parser::Functions.function(:format_allocation_pools)

View File

@ -5,11 +5,7 @@ describe 'function for formating allocation pools for neutron subnet resource' d
def setup_scope
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("floppy", :environment => 'production'))
if Puppet.version =~ /^3\./
@scope = Puppet::Parser::Scope.new(@compiler)
else
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
end
@scope = Puppet::Parser::Scope.new(@compiler)
@topscope = @topscope
@scope.parent = @topscope
Puppet::Parser::Functions.function(:generate_bridge_mappings)

View File

@ -5,11 +5,7 @@ describe 'function for formating allocation pools for neutron subnet resource' d
def setup_scope
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("floppy", :environment => 'production'))
if Puppet.version =~ /^3\./
@scope = Puppet::Parser::Scope.new(@compiler)
else
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
end
@scope = Puppet::Parser::Scope.new(@compiler)
@topscope = @topscope
@scope.parent = @topscope
Puppet::Parser::Functions.function(:generate_physnet_mtus)

View File

@ -5,11 +5,7 @@ describe 'function for formating allocation pools for neutron subnet resource' d
def setup_scope
@compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("floppy", :environment => 'production'))
if Puppet.version =~ /^3\./
@scope = Puppet::Parser::Scope.new(@compiler)
else
@scope = Puppet::Parser::Scope.new(:compiler => @compiler)
end
@scope = Puppet::Parser::Scope.new(@compiler)
@topscope = @topscope
@scope.parent = @topscope
Puppet::Parser::Functions.function(:generate_physnet_vlan_ranges)

View File

@ -2,6 +2,13 @@ require 'spec_helper'
describe 'get_ssl_property' do
let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
subject do
function_name = Puppet::Parser::Functions.function(:get_ssl_property)
scope.method(function_name)
end
let(:public_ssl_hash) do
{
'horizon' => true,

View File

@ -7,10 +7,8 @@ PROJECT_ROOT = File.expand_path('..', File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(PROJECT_ROOT, "lib"))
# Add fixture lib dirs to LOAD_PATH. Work-around for PUP-3336
if Puppet.version < '4.0.0'
Dir["#{fixture_path}/modules/*/lib"].entries.each do |lib_dir|
$LOAD_PATH << lib_dir
end
Dir["#{fixture_path}/modules/*/lib"].entries.each do |lib_dir|
$LOAD_PATH << lib_dir
end
RSpec.configure do |c|