Skip to content

Commit b97d70c

Browse files
authored
Merge pull request #1308 from alexjfisher/PUP-11752
(PUP-11752) Fix fqdn_rand_string_spec.rb test
2 parents 031c9ad + 4500232 commit b97d70c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: spec/functions/fqdn_rand_string_spec.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ def fqdn_rand_string(max, args = {})
5757

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

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

0 commit comments

Comments
 (0)