{"issue":{"created_at":"2011-12-14T12:44:42Z","state":"open","updated_at":"2011-12-14T14:03:39Z","user":{"gravatar_id":"99e0b39c091e10d9c7d4452a34ca52dc","id":5387,"url":"https://api.github.com/users/weppos","login":"weppos","avatar_url":"https://secure.gravatar.com/avatar/99e0b39c091e10d9c7d4452a34ca52dc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"Discovered in #125\r\n\r\n```\r\nweppos-macair:money weppos$ export JRUBY_OPTS=--1.9\r\nweppos-macair:money weppos$ jruby -v\r\njruby 1.6.5 (ruby-1.9.2-p136) (2011-10-25 9dcd388) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_29) [darwin-x86_64-java]\r\nweppos-macair:money weppos$ rake\r\n/Users/weppos/.rvm/rubies/jruby-1.6.5/bin/jruby -S rspec ./spec/core_extensions_spec.rb ./spec/currency_spec.rb ./spec/money_spec.rb ./spec/bank/base_spec.rb ./spec/bank/variable_exchange_spec.rb ./spec/money/arithmetic_spec.rb ./spec/money/formatting_spec.rb ./spec/money/parsing_spec.rb\r\n..............................................................................................................................................................................F.F.F........F...F.F.F.........F............................\r\n\r\nFailures:\r\n\r\n  1) Money formatting#format respects :subunit_to_unit currency property\r\n     Failure/Error: Money.new(10_00, \"BHD\").format.should == \"ب.د1.000\"\r\n       expected: \"ب.د1.000\"\r\n            got: \"\\xD8\\xA8.\\xD8\\xAF1.000\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:93:in `(root)'\r\n\r\n  2) Money formatting#format respects the thousands_separator and decimal_mark defaults\r\n     Failure/Error: one_thousand[\"GBP\"].should == \"£1,000.00\"\r\n       expected: \"£1,000.00\"\r\n            got: \"\\xC2\\xA31,000.00\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:106:in `(root)'\r\n\r\n  3) Money formatting#format inserts thousands separator into the result if the amount is sufficiently large and the currency symbol is at the end\r\n     Failure/Error: Money.euro(1_234_567_12).format.should == \"1.234.567,12 €\"\r\n       expected: \"1.234.567,12 €\"\r\n            got: \"1.234.567,12 \\xE2\\x82\\xAC\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:142:in `(root)'\r\n\r\n  4) Money formatting Money formatting#format :no_cents option respects :subunit_to_unit currency property\r\n     Failure/Error: Money.new(10_00, \"BHD\").format(:no_cents => true).should == \"ب.د1\"\r\n       expected: \"ب.د1\"\r\n            got: \"\\xD8\\xA8.\\xD8\\xAF1\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:162:in `(root)'\r\n\r\n  5) Money formatting Money formatting#format :symbol option (:symbol => true) returns symbol based on the given currency code\r\n     Failure/Error: one[\"GBP\"].should == \"£1.00\"\r\n       expected: \"£1.00\"\r\n            got: \"\\xC2\\xA31.00\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:205:in `(root)'\r\n\r\n  6) Money formatting Money formatting#format :symbol option (:symbol => some non-Boolean value that evaluates to true) returns symbol based on the given currency code\r\n     Failure/Error: Money.new(100, \"GBP\").format(:symbol => true).should == \"£1.00\"\r\n       expected: \"£1.00\"\r\n            got: \"\\xC2\\xA31.00\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:242:in `(root)'\r\n\r\n  7) Money formatting Money formatting#format :symbol option defaults :symbol to true\r\n     Failure/Error: money.format.should == \"£1.00\"\r\n       expected: \"£1.00\"\r\n            got: \"\\xC2\\xA31.00\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:259:in `(root)'\r\n\r\n  8) Money formatting Money formatting#format :symbol_position option inserts currency symbol before the amount when set to :before\r\n     Failure/Error: Money.euro(1_234_567_12).format(:symbol_position => :before).should == \"€1.234.567,12\"\r\n       expected: \"€1.234.567,12\"\r\n            got: \"\\xE2\\x82\\xAC1.234.567,12\" (using ==)\r\n     # ./spec/money/formatting_spec.rb:317:in `(root)'\r\n\r\nFinished in 17.18 seconds\r\n234 examples, 8 failures\r\n\r\nFailed examples:\r\n\r\nrspec ./spec/money/formatting_spec.rb:92 # Money formatting#format respects :subunit_to_unit currency property\r\nrspec ./spec/money/formatting_spec.rb:100 # Money formatting#format respects the thousands_separator and decimal_mark defaults\r\nrspec ./spec/money/formatting_spec.rb:141 # Money formatting#format inserts thousands separator into the result if the amount is sufficiently large and the currency symbol is at the end\r\nrspec ./spec/money/formatting_spec.rb:161 # Money formatting Money formatting#format :no_cents option respects :subunit_to_unit currency property\r\nrspec ./spec/money/formatting_spec.rb:199 # Money formatting Money formatting#format :symbol option (:symbol => true) returns symbol based on the given currency code\r\nrspec ./spec/money/formatting_spec.rb:241 # Money formatting Money formatting#format :symbol option (:symbol => some non-Boolean value that evaluates to true) returns symbol based on the given currency code\r\nrspec ./spec/money/formatting_spec.rb:254 # Money formatting Money formatting#format :symbol option defaults :symbol to true\r\nrspec ./spec/money/formatting_spec.rb:316 # Money formatting Money formatting#format :symbol_position option inserts currency symbol before the amount when set to :before\r\norg.jruby.exceptions.RaiseException: (SystemExit) exit\r\nrake aborted!\r\nruby /Users/weppos/.rvm/rubies/jruby-1.6.5/bin/jruby -S rspec ./spec/core_extensions_spec.rb ./spec/currency_spec.rb ./spec/money_spec.rb ./spec/bank/base_spec.rb ./spec/bank/variable_exchange_spec.rb ./spec/money/arithmetic_spec.rb ./spec/money/formatting_spec.rb ./spec/money/parsing_spec.rb failed\r\n\r\nTasks: TOP => default => spec\r\n(See full trace by running task with --trace)\r\nweppos-macair:money weppos$ \r\n```\r\n\r\n/cc @semmons99","assignee":{"gravatar_id":"99e0b39c091e10d9c7d4452a34ca52dc","id":5387,"url":"https://api.github.com/users/weppos","login":"weppos","avatar_url":"https://secure.gravatar.com/avatar/99e0b39c091e10d9c7d4452a34ca52dc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":2550997,"labels":[{"name":"bug","color":"ff0000","url":"https://api.github.com/repos/RubyMoney/money/labels/bug"}],"number":131,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Tests fail with jruby 1.6.5 in 1.9 mode","html_url":"https://github.com/RubyMoney/money/issues/131","closed_at":null,"url":"https://api.github.com/repos/RubyMoney/money/issues/131","milestone":null},"action":"created","comment":{"created_at":"2011-12-14T14:03:39Z","updated_at":"2011-12-14T14:03:39Z","user":{"gravatar_id":"99e0b39c091e10d9c7d4452a34ca52dc","id":5387,"url":"https://api.github.com/users/weppos","login":"weppos","avatar_url":"https://secure.gravatar.com/avatar/99e0b39c091e10d9c7d4452a34ca52dc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"The issue seems to be caused by the JSON.parse line.\r\n\r\nReading the JSON file in jRuby works perfectly. But as soon as the JSON string is parsed, the symbol is converted.\r\n\r\n```\r\njruby-1.6.5 :005 > j = JSON.parse(s)\r\njruby-1.6.5 :006 > j[\"eur\"]\r\n => {\"priority\"=>2, \"iso_code\"=>\"EUR\", \"name\"=>\"Euro\", \"symbol\"=>\"\\xE2\\x82\\xAC\", \"subunit\"=>\"Cent\", \"subunit_to_unit\"=>100, \"symbol_first\"=>false, \"html_entity\"=>\"&#x20AC;\", \"decimal_mark\"=>\",\", \"thousands_separator\"=>\".\", \"iso_numeric\"=>\"978\"} \r\n```","id":3139830,"url":"https://api.github.com/repos/RubyMoney/money/issues/comments/3139830"}}