AS Json parse_error makes a return for backwards compatibility, although it will return MultiJson::DecodeError

This commit is contained in:
Josh Kalderimis 2011-04-19 00:01:50 +02:00
parent e019587e31
commit 1d8be7bc6f
2 changed files with 5 additions and 1 deletions

View File

@ -34,6 +34,10 @@ module ActiveSupport
self.backend = old_backend
end
def parse_error
MultiJson::DecodeError
end
private
def convert_dates_from(data)

View File

@ -82,7 +82,7 @@ class TestJSONDecoding < ActiveSupport::TestCase
end
def test_failed_json_decoding
assert_raise(MultiJson::DecodeError) { ActiveSupport::JSON.decode(%({: 1})) }
assert_raise(ActiveSupport::JSON.parse_error) { ActiveSupport::JSON.decode(%({: 1})) }
end
end