dewski / json_builder

Rails provides an excellent XML Builder by default to build RSS and ATOM feeds, but nothing to help you build complex and custom JSON data structures. JSON Builder is here to help.
http://garrettbjerkhoel.com/json_builder/
MIT License
244 stars 52 forks source link

adding tests with unicode chars #21

Closed plentz closed 12 years ago

plentz commented 12 years ago

Some of them don't work with JRuby 1.6.7 with 1.9 mode. This is part of my effort to make the world a better place intridea/multi_json#25.

dewski commented 12 years ago

I went ahead and merged this in, but changed the tests to not have unicode method names for back support for 1.8.7. If people using Ruby ~> 1.9.2 and want to use that, it'll work. I found the issue in the extensions when calling to_builder, it'd also call inspect which produced varied results across 1.8.7 and 1.9.2 when comparing 2 unicoded strings, so I changed it to returning the string with quotes instead of expecting inspect to do it. (re: https://github.com/dewski/json_builder/blob/master/lib/json_builder/extensions.rb#L15)

plentz commented 12 years ago

great! btw, I think we can make some 1.9.x-only tests. I will look at it later.