Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.6, JRuby 1.6.7, JRuby 1.7.0.pre1
-
Fix Version/s: None
-
Component/s: Encoding
-
Labels:None
-
Number of attachments :
Description
I think that looking directly to the source code will make it easier to understand: https://raw.github.com/plentz/jruby_report/6ca21e77b80d60619c863fcf447626db676dde22/json_builder_test.rb
The first one breaks, the second one works. Already created a pull request adding some more tests to the json_builder gem(https://github.com/dewski/json_builder/pull/21)
It would be helpful to know what you mean by "breaks". It seems like we're able to call the method correctly, and produce a result, but we're not inspecting the string right somewhere (and as a result the inspected output has the escaped character).
1) Failure: test_json_generation_with_unicode_in_key(JsonBuilderTest) [blah.rb:14]: Expected "{\"é\": \"json\"}", not "{\"\u00E9\": \"json\"}".The failure is the same on master, but the escape matches how MRI would escape the character now:
1) Failure: test_json_generation_with_unicode_in_key(JsonBuilderTest) [../jruby2/blah.rb:14]: Expected: "{\"é\": \"json\"}" Actual: "{\"\xE9\": \"json\"}"