File tree 2 files changed +6
-6
lines changed
lib/puppet/parser/functions
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
26
26
27
27
result = if value . is_a? ( Array )
28
28
# 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 }
30
30
else
31
- URI . escape ( value )
31
+ URI :: DEFAULT_PARSER . escape ( value )
32
32
end
33
33
34
34
return result
Original file line number Diff line number Diff line change 16
16
end
17
17
18
18
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
21
21
is_expected . to run . with_params ( 'uri_string' ) . and_return ( 'escaped_uri_string' )
22
22
end
23
23
end
24
24
25
25
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
27
27
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
29
29
is_expected . to run . with_params ( uri_string ) . and_return ( 'escaped_uri_string' )
30
30
end
31
31
end
You can’t perform that action at this time.
0 commit comments