Skip to content

Instantly share code, notes, and snippets.

@plentz
Created February 21, 2012 02:51
Show Gist options
  • Save plentz/1873224 to your computer and use it in GitHub Desktop.
Save plentz/1873224 to your computer and use it in GitHub Desktop.

https://github.com/plentz/jruby_report/blob/master/ok_json_test.rb

~/Projects/opensource/jruby_report (master) $ ruby -I. ok_json_test.rb 
Run options: --seed 31809

# Running tests:

"\xEF\xBF\xBD"
..F

Finished tests in 0.049639s, 60.4364 tests/s, 60.4364 assertions/s.

  1) Failure:
test_json_encode(OkJsonTest) [ok_json_test.rb:14]:
Expected: "{\"message\":\"á\"}"
  Actual: "{\"message\":\"\\ufffd\"}"

3 tests, 3 assertions, 1 failures, 0 errors, 0 skips

to this


~/Projects/opensource/jruby_report (master) $ ruby -I. ok_json_test.rb 
Run options: --seed 3567

# Running tests:

.FF

Finished tests in 0.028424s, 105.5446 tests/s, 105.5446 assertions/s.

  1) Failure:
test_decode_bad(OkJsonTest) [ok_json_test.rb:24]:
Expected: "\xEF\xBF\xBD"
  Actual: "�"

  2) Failure:
test_json_encode(OkJsonTest) [ok_json_test.rb:14]:
Expected: "{\"message\":\"á\"}"
  Actual: "{\"message\":\"\\u00e1\"}"

3 tests, 3 assertions, 2 failures, 0 errors, 0 skips
~/Projects/opensource/jruby_report (master) $ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
@kr
Copy link

kr commented Feb 22, 2012

Yes, both are correct.

@plentz
Copy link
Author

plentz commented Feb 22, 2012

@kr, sorry to bother you, but I think you would like to read this intridea/multi_json#25 (comment) (btw, thanks for helping me till now :)

@kr
Copy link

kr commented Feb 23, 2012

Hey, no problem. That sounds about right. I've thought about this a few times before,
but it didn't seem like a big deal.

I just made kr/okjson#4 so I don't forget about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment