Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use `Object#respond_to?` to determine which MultiJson API to use

Closes #51.
  • Loading branch information...
commit 7057268fb6464c8840d6d09acc6df44eb81f5a0b 1 parent b7e22aa
Erik Michaels-Ober authored

Showing 1 changed file with 5 additions and 1 deletion. Show diff stats Hide diff stats

  1. 6  lib/capybara/poltergeist/browser.rb
6  lib/capybara/poltergeist/browser.rb
@@ -114,7 +114,11 @@ def command(name, *args)
114 114
       message = { 'name' => name, 'args' => args }
115 115
       log message.inspect
116 116
 
117  
-      json = MultiJson.load(server.send(MultiJson.dump(message)))
  117
+      json = if MultiJson.respond_to?(:dump) && MultiJson.respond_to?(:load)
  118
+        MultiJson.load(server.send(MultiJson.dump(message)))
  119
+      else
  120
+        MultiJson.decode(server.send(MultiJson.encode(message)))
  121
+      end
118 122
       log json.inspect
119 123
 
120 124
       if json['error']

0 notes on commit 7057268

Please sign in to comment.
Something went wrong with that request. Please try again.