Permalink
Browse files

AS Json parse_error makes a return for backwards compatibility, altho…

…ugh it will return MultiJson::DecodeError
  • Loading branch information...
1 parent e019587 commit 1d8be7bc6f098b829ac14ef457af688043975ddc @joshk joshk committed Apr 18, 2011
Showing with 5 additions and 1 deletion.
  1. +4 −0 activesupport/lib/active_support/json/decoding.rb
  2. +1 −1 activesupport/test/json/decoding_test.rb
@@ -34,6 +34,10 @@ def with_backend(name)
self.backend = old_backend
end
+ def parse_error
+ MultiJson::DecodeError
+ end
+
private
def convert_dates_from(data)
@@ -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

0 comments on commit 1d8be7b

Please sign in to comment.