Permalink
Browse files

Switch back to MultiJson's deprecated decode method as it no longer b…

…arfs deprecation warnings
  • Loading branch information...
1 parent c2c3780 commit 02aa6332fdbef92fd94cc424af7d1de5ae9262da @laserlemon laserlemon committed Apr 30, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 lib/json_spec/helpers.rb
View
@@ -5,10 +5,10 @@ module Helpers
extend self
def parse_json(json, path = nil)
- ruby = multi_json_load("[#{json}]").first
+ ruby = MultiJson.decode("[#{json}]").first
value_at_json_path(ruby, path)
rescue MultiJson::DecodeError
- multi_json_load(json)
+ MultiJson.decode(json)
end
def normalize_json(json, path = nil)
@@ -31,10 +31,6 @@ def load_json(relative_path)
end
private
- def multi_json_load(json)
- MultiJson.respond_to?(:load) ? MultiJson.load(json) : MultiJson.decode(json)
- end
-
def value_at_json_path(ruby, path)
return ruby unless path

0 comments on commit 02aa633

Please sign in to comment.