2014-12-30 17:25:09 -05:00
|
|
|
# encoding: utf-8
|
|
|
|
|
2015-01-02 12:34:40 -05:00
|
|
|
Shindo.tests('AWS | signed_params', ['aws']) do
|
2018-10-16 18:12:42 -04:00
|
|
|
returns(Fog::AWS.escape("'Stöp!' said Fred_-~./")) { '%27St%C3%B6p%21%27%20said%20Fred_-~.%2F' }
|
2014-12-30 17:25:09 -05:00
|
|
|
|
|
|
|
tests('Unicode characters should be escaped') do
|
2018-10-16 18:12:42 -04:00
|
|
|
unicode = ['00E9'.to_i(16)].pack('U*')
|
|
|
|
escaped = '%C3%A9'
|
|
|
|
returns(escaped) { Fog::AWS.escape(unicode) }
|
2014-12-30 17:25:09 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
tests('Unicode characters with combining marks should be escaped') do
|
2018-10-16 18:12:42 -04:00
|
|
|
unicode = ['0065'.to_i(16), '0301'.to_i(16)].pack('U*')
|
|
|
|
escaped = 'e%CC%81'
|
|
|
|
returns(escaped) { Fog::AWS.escape(unicode) }
|
2014-12-30 17:25:09 -05:00
|
|
|
end
|
|
|
|
end
|