Skip to content

(PUP-11752) Fix fqdn_rand_string_spec.rb test #1308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion spec/functions/fqdn_rand_string_spec.rb
Original file line number Diff line number Diff line change
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