File tree Expand file tree Collapse file tree
lib/puppet/parser/functions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,21 +15,9 @@ module Puppet::Parser::Functions
1515 called 'jenkins_version' (note that parameters set in the Puppet Dashboard/
1616 Enterprise Console are brought into Puppet as top-scope variables), and,
1717 failing that, will use a default value of 1.449.
18-
19- If you have `strict_variables` turned on, then wrap your variable in single
20- quotes to prevent interpolation and this function will check to see if that
21- variable exists.
22-
23- $real_jenkins_version = pick('$::jenkins_version', '1.449')
24-
2518DOC
2619 ) do |args |
27- # look up the values of any strings that look like '$variables' w/o mutating args
28- args = args . map do |item |
29- next item unless item . is_a? String
30- item . start_with? ( '$' ) ? call_function ( 'getvar' , [ item . slice ( 1 ..-1 ) ] ) : item
31- end
32- args . compact!
20+ args = args . compact
3321 args . delete ( :undef )
3422 args . delete ( :undefined )
3523 args . delete ( '' )
Original file line number Diff line number Diff line change 99 it { is_expected . to run . with_params ( :undef , 'two' ) . and_return ( 'two' ) }
1010 it { is_expected . to run . with_params ( :undefined , 'two' ) . and_return ( 'two' ) }
1111 it { is_expected . to run . with_params ( nil , 'two' ) . and_return ( 'two' ) }
12- it { is_expected . to run . with_params ( '$foo' , 'two' ) . and_return ( 'two' ) }
13- it { is_expected . to run . with_params ( '$puppetversion' , 'two' ) . and_return ( Puppet . version ) }
14- it { is_expected . to run . with_params ( '$::puppetversion' , 'two' ) . and_return ( Puppet . version ) }
1512
1613 context 'with UTF8 and double byte characters' do
1714 it { is_expected . to run . with_params ( nil , 'このテキスト' ) . and_return ( 'このテキスト' ) }
You can’t perform that action at this time.
0 commit comments