Sha256: ac50c12936000fe560ab45f585c330c178eb83efba3ecce7935cfe0b37fbcf29

Contents?: true

Size: 674 Bytes

Versions: 4

Compression:

Stored size: 674 Bytes

Contents

# -*- encoding: utf-8 -*-

require File.dirname(__FILE__) + '/test_helper.rb'

class TestOauth < Test::Unit::TestCase

  def test_parameter_escaping_kcode_invariant
    ruby19 = RUBY_VERSION =~ /^1\.9/
    old = $KCODE if !ruby19
    begin
      %w(n N e E s S u U).each do |kcode|
        $KCODE = kcode if !ruby19
        assert_equal '%E3%81%82', OAuth::Helper.escape('あ'),
                      "Failed to correctly escape Japanese under $KCODE = #{kcode}"
        assert_equal '%C3%A9', OAuth::Helper.escape('é'),
                      "Failed to correctly escape e+acute under $KCODE = #{kcode}"
      end
    ensure
      $KCODE = old if !ruby19
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
apigee-oauth-0.4.0 test/test_signature.rb
oauth-0.4.1 test/test_signature.rb
oauth-0.4.0 test/test_signature.rb
oauth-0.3.7.pre1 test/test_signature.rb