Skip to content

Commit

Permalink
Merge pull request #1308 from alexjfisher/PUP-11752
Browse files Browse the repository at this point in the history
(PUP-11752) Fix fqdn_rand_string_spec.rb test
  • Loading branch information
bastelfreak committed Apr 21, 2023
2 parents 031c9ad + 4500232 commit b97d70c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec/functions/fqdn_rand_string_spec.rb
Expand Up @@ -57,7 +57,11 @@ def fqdn_rand_string(max, args = {})

# workaround not being able to use let(:facts) because some tests need
# multiple different hostnames in one context
allow(scope).to receive(:lookupvar).with('::fqdn', {}).and_return(host)
if Gem::Version.new(Puppet::PUPPETVERSION) < Gem::Version.new('7.23.0')
allow(scope).to receive(:lookupvar).with('::fqdn', {}).and_return(host)
else
allow(scope).to receive(:lookupvar).with('facts', {}).and_return({ 'networking' => { 'fqdn' => host } })
end

function_args = [max]
if args.key?(:charset) || !extra.empty?
Expand Down

0 comments on commit b97d70c

Please sign in to comment.