Permalink
Browse files

Changing to MultiJson's newer load method

  • Loading branch information...
1 parent da68e67 commit 9d72cdb9d1f051951563cbe0c1f3372795ce3dfa @zmoazeni zmoazeni committed Apr 18, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 json_spec.gemspec
  2. +2 −2 lib/json_spec/helpers.rb
View
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
gem.description = "Easily handle JSON in RSpec and Cucumber"
gem.homepage = "https://github.com/collectiveidea/json_spec"
- gem.add_dependency "multi_json", "~> 1.0"
+ gem.add_dependency "multi_json", ">= 1.3.0"
gem.add_dependency "rspec", "~> 2.0"
gem.add_development_dependency "cucumber", "~> 1.1", ">= 1.1.1"
@@ -5,10 +5,10 @@ module Helpers
extend self
def parse_json(json, path = nil)
- ruby = MultiJson.decode(%([#{json}])).first
+ ruby = MultiJson.load(%([#{json}])).first
value_at_json_path(ruby, path)
rescue MultiJson::DecodeError
- MultiJson.decode(json)
+ MultiJson.load(json)
end
def normalize_json(json, path = nil)

0 comments on commit 9d72cdb

Please sign in to comment.