Skip to content

Commit afa056b

Browse files
committed
(PE-20308) Also fix defined type strings & references
1 parent b1c2e50 commit afa056b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/puppet/parser/functions/defined_with_params.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
if reference.is_a?(String)
3131
type_name, title = Puppet::Resource.type_and_title(reference, nil)
3232
type = Puppet::Type.type(type_name)
33+
type = type_name if type.nil?
3334
elsif reference.is_a?(Puppet::Resource)
3435
type = reference.resource_type
3536
title = reference.title

spec/functions/defined_with_params_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,7 @@
6262
end
6363
it { is_expected.to run.with_params('Test::Deftype[foo]', {}).and_return(true) }
6464
it { is_expected.to run.with_params('Test::Deftype[bar]', {}).and_return(false) }
65+
it { is_expected.to run.with_params(Puppet::Resource.new('Test::Deftype[foo]'), {}).and_return(true) }
66+
it { is_expected.to run.with_params(Puppet::Resource.new('Test::Deftype[bar]'), {}).and_return(false) }
6567
end
6668
end

0 commit comments

Comments
 (0)