forked from mojodna/oauth
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the reserved characters regex to be non-variant by $KCODE
- Loading branch information
Showing
3 changed files
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,11 +1,19 @@ | |||
require File.dirname(__FILE__) + '/test_helper.rb' | require File.dirname(__FILE__) + '/test_helper.rb' | ||
|
|
||
class TestOauth < Test::Unit::TestCase | class TestOauth < Test::Unit::TestCase | ||
|
|
||
def setup | def test_parameter_escaping_kcode_invariant | ||
end | old = $KCODE | ||
|
begin | ||
def test_truth | %w(n N e E s S u U).each do |kcode| | ||
assert true | $KCODE = kcode | ||
end | assert_equal '%E3%81%82', OAuth::Helper.escape('あ'), | ||
end | "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 | |||
end | |||
end | |||
end |