File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
lib/puppet/parser/functions Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ module Puppet::Parser::Functions
2626
2727 result = if value . is_a? ( Array )
2828 # Numbers in Puppet are often string-encoded which is troublesome ...
29- value . map { |i | i . is_a? ( String ) ? URI . escape ( i ) : i }
29+ value . map { |i | i . is_a? ( String ) ? URI :: DEFAULT_PARSER . escape ( i ) : i }
3030 else
31- URI . escape ( value )
31+ URI :: DEFAULT_PARSER . escape ( value )
3232 end
3333
3434 return result
Original file line number Diff line number Diff line change 1616 end
1717
1818 describe 'handling normal strings' do
19- it 'calls ruby\'s URI.escape function' do
20- expect ( URI ) . to receive ( :escape ) . with ( 'uri_string' ) . and_return ( 'escaped_uri_string' ) . once
19+ it 'calls ruby\'s URI::DEFAULT_PARSER .escape function' do
20+ expect ( URI :: DEFAULT_PARSER ) . to receive ( :escape ) . with ( 'uri_string' ) . and_return ( 'escaped_uri_string' ) . once
2121 is_expected . to run . with_params ( 'uri_string' ) . and_return ( 'escaped_uri_string' )
2222 end
2323 end
2424
2525 describe 'handling classes derived from String' do
26- it 'calls ruby\'s URI.escape function' do
26+ it 'calls ruby\'s URI::DEFAULT_PARSER .escape function' do
2727 uri_string = AlsoString . new ( 'uri_string' )
28- expect ( URI ) . to receive ( :escape ) . with ( uri_string ) . and_return ( 'escaped_uri_string' ) . once
28+ expect ( URI :: DEFAULT_PARSER ) . to receive ( :escape ) . with ( uri_string ) . and_return ( 'escaped_uri_string' ) . once
2929 is_expected . to run . with_params ( uri_string ) . and_return ( 'escaped_uri_string' )
3030 end
3131 end
You can’t perform that action at this time.
0 commit comments