From 08188316248e7221d7d7eb77bc0eb512fc42c183 Mon Sep 17 00:00:00 2001 From: Matthew Horan Date: Fri, 22 Feb 2013 22:29:44 -0500 Subject: [PATCH] Use JSON.load to instantiate errors As of JSON 1.7.7, JSON.parse no longer instantiates json_class as specified in the source document. JSON.load retains the original behavior. --- Gemfile.lock | 4 +++- lib/capybara/webkit/browser.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1e301fa..97d2e8d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -23,7 +23,8 @@ GEM ffi (~> 1.0, >= 1.0.6) diff-lcs (1.1.2) ffi (1.2.0) - json (1.7.6) + ffi (1.2.0-x86-mingw32) + json (1.7.7) libwebsocket (0.1.7.1) addressable websocket @@ -32,6 +33,7 @@ GEM subexec (~> 0.0.4) multi_json (1.5.0) nokogiri (1.5.6) + nokogiri (1.5.6-x86-mingw32) rack (1.4.1) rack-test (0.6.2) rack (>= 1.0) diff --git a/lib/capybara/webkit/browser.rb b/lib/capybara/webkit/browser.rb index beeec2e..43cd378 100644 --- a/lib/capybara/webkit/browser.rb +++ b/lib/capybara/webkit/browser.rb @@ -208,7 +208,7 @@ module Capybara::Webkit if result.nil? raise NoResponseError, "No response received from the server." elsif result != 'ok' - raise JSON.parse(read_response) + raise JSON.load(read_response) end result