Skip to content

Commit 0e5bb5b

Browse files
etiennebarriep0deje
authored andcommitted
Fix autoload of WebDriver::Remote::Bridge::COMMANDS
COMMANDS is defined on WebDriver::Remote::Bridge, but is defined as an autoload on WebDriver::Remote. Since it's used in WebDriver::Remote::Bridge#commands (with all the namespaces nested), Ruby will first look for the constant in WebDriver::Remote::Bridge, then WebDriver::Remote, where it finds the autoload. It requires the file, which defines WebDriver::Remote::Bridge::COMMANDS. Then Ruby emits a warning, because it expected selenium/webdriver/remote/commands to define WebDriver::Remote::COMMANDS, since that's what the autoload declares. After that, the constant can be resolved so it still works. This properly declares the constant as autoloaded under WebDriver::Remote::Bridge.
1 parent 20d68b3 commit 0e5bb5b

File tree

3 files changed

+1
-1
lines changed

3 files changed

+1
-1
lines changed

rb/lib/selenium/webdriver/remote.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ module Remote
2727
autoload :Driver, 'selenium/webdriver/remote/driver'
2828
autoload :Response, 'selenium/webdriver/remote/response'
2929
autoload :Capabilities, 'selenium/webdriver/remote/capabilities'
30-
autoload :COMMANDS, 'selenium/webdriver/remote/commands'
3130

3231
module Http
3332
autoload :Common, 'selenium/webdriver/remote/http/common'

rb/lib/selenium/webdriver/remote/bridge.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Selenium
2121
module WebDriver
2222
module Remote
2323
class Bridge
24+
autoload :COMMANDS, 'selenium/webdriver/remote/bridge/commands'
2425
include Atoms
2526

2627
PORT = 4444

0 commit comments

Comments
 (0)