Skip to content

Commit c64a624

Browse files
committed
rb: Add IE.driver_path accessor just like other drivers
1 parent a151e56 commit c64a624

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

rb/lib/selenium/webdriver/ie.rb

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,28 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919

20+
require 'selenium/webdriver/ie/server'
21+
require 'selenium/webdriver/ie/bridge'
22+
2023
module Selenium
2124
module WebDriver
22-
23-
# @api private
2425
module IE
26+
MISSING_TEXT = "Unable to find standalone executable. Please download the IEDriverServer from http://selenium-release.storage.googleapis.com/index.html and place the executable on your PATH."
27+
2528
def self.driver_path=(path)
2629
Platform.assert_executable path
2730
@driver_path = path
2831
end
2932

3033
def self.driver_path
31-
@driver_path ||= nil
32-
end
34+
@driver_path ||= begin
35+
path = Platform.find_binary("IEDriverServer")
36+
path or raise Error::WebDriverError, MISSING_TEXT
37+
Platform.assert_executable path
3338

39+
path
40+
end
41+
end
3442
end # IE
3543
end # WebDriver
3644
end # Selenium
37-
38-
require 'selenium/webdriver/ie/server'
39-
require 'selenium/webdriver/ie/bridge'

rb/lib/selenium/webdriver/ie/server.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,9 @@ class Server
2929

3030
STOP_TIMEOUT = 5
3131
SOCKET_LOCK_TIMEOUT = 45
32-
MISSING_TEXT = "Unable to find standalone executable. Please download the IEDriverServer from http://selenium-release.storage.googleapis.com/index.html and place the executable on your PATH."
3332

3433
def self.get(opts = {})
35-
binary = IE.driver_path || Platform.find_binary("IEDriverServer")
36-
37-
if binary
38-
new binary, opts
39-
else
40-
raise Error::WebDriverError, MISSING_TEXT
41-
end
34+
new IE.driver_path, opts
4235
end
4336

4437
attr_accessor :log_level, :log_file

0 commit comments

Comments
 (0)