Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #52 from sferik/issue_51

MultiJson feature-detection
  • Loading branch information...
commit 479da435faa58006bc9c2169953e7b9700fab202 2 parents b1c65ec + 7057268
@jonleighton jonleighton authored
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/capybara/poltergeist/browser.rb
  2. +1 −1  poltergeist.gemspec
View
6 lib/capybara/poltergeist/browser.rb
@@ -114,7 +114,11 @@ def command(name, *args)
message = { 'name' => name, 'args' => args }
log message.inspect
- json = MultiJson.load(server.send(MultiJson.dump(message)))
+ json = if MultiJson.respond_to?(:dump) && MultiJson.respond_to?(:load)
+ MultiJson.load(server.send(MultiJson.dump(message)))
+ else
+ MultiJson.decode(server.send(MultiJson.encode(message)))
+ end
log json.inspect
if json['error']
View
2  poltergeist.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.description = "PhantomJS driver for Capybara"
s.add_dependency "capybara", "~> 1.0"
- s.add_dependency "multi_json", "~> 1.3"
+ s.add_dependency "multi_json", "~> 1.0"
s.add_dependency "childprocess", "~> 0.3"
s.add_dependency "http_parser.rb", "~> 0.5.3"
s.add_dependency "faye-websocket", "~> 0.4", ">= 0.4.4"
Please sign in to comment.
Something went wrong with that request. Please try again.