aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/json
diff options
context:
space:
mode:
authorGaurish Sharma <contact@gaurishsharma.com>2013-08-07 13:19:14 +0530
committerGaurish Sharma <contact@gaurishsharma.com>2013-08-07 13:19:14 +0530
commit7191a5d8307e8d5ccbf683656b5b4e9957ab34fa (patch)
tree25a41550f2746b38a1600a9b15e8da1c3cb21427 /activesupport/test/json
parentda49e9a9f092d2d98da9e96fcecd39ef121239dc (diff)
downloadrails-7191a5d8307e8d5ccbf683656b5b4e9957ab34fa.tar.gz
rails-7191a5d8307e8d5ccbf683656b5b4e9957ab34fa.tar.bz2
rails-7191a5d8307e8d5ccbf683656b5b4e9957ab34fa.zip
Avoid defining multibyte method names in JSON decoding test for JRuby Compat
This change is similar to #11736 & in same way switched with fixed string & the index of the hash for method name. the index was added because otherwise, ruby will raise Error.
Diffstat (limited to 'activesupport/test/json')
-rw-r--r--activesupport/test/json/decoding_test.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb
index 34ed866848..99c5f2d1ec 100644
--- a/activesupport/test/json/decoding_test.rb
+++ b/activesupport/test/json/decoding_test.rb
@@ -55,12 +55,13 @@ class TestJSONDecoding < ActiveSupport::TestCase
%q({"a":"Line1\u000aLine2"}) => {"a"=>"Line1\nLine2"}
}
- TESTS.each do |json, expected|
- test "json decodes #{json}" do
+ TESTS.each_with_index do |(json, expected), index|
+ test "json decodes #{index}" do
prev = ActiveSupport.parse_json_times
ActiveSupport.parse_json_times = true
silence_warnings do
- assert_equal expected, ActiveSupport::JSON.decode(json)
+ assert_equal expected, ActiveSupport::JSON.decode(json), "JSON decoding \
+ failed for #{json}"
end
ActiveSupport.parse_json_times = prev
end