Skip to content

Commit

Permalink
Use empty capabilities when user omits them at all
Browse files Browse the repository at this point in the history
Closes #5185
  • Loading branch information
p0deje committed Dec 7, 2017
1 parent 01131b2 commit 6dda78f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rb/lib/selenium/webdriver/remote/bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ class Bridge
# @return [OSS:Bridge, W3C::Bridge]
#
def self.handshake(**opts)
desired_capabilities = opts.delete(:desired_capabilities)
desired_capabilities = opts.delete(:desired_capabilities) { Capabilities.new }

if desired_capabilities.is_a?(Symbol)
unless Remote::Capabilities.respond_to?(desired_capabilities)
unless Capabilities.respond_to?(desired_capabilities)
raise Error::WebDriverError, "invalid desired capability: #{desired_capabilities.inspect}"
end
desired_capabilities = Remote::Capabilities.__send__(desired_capabilities)
desired_capabilities = Capabilities.__send__(desired_capabilities)
end

bridge = new(opts)
Expand Down

0 comments on commit 6dda78f

Please sign in to comment.