Skip to content

Commit

Permalink
Make Ruby tests work on UNC paths
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Apr 27, 2017
1 parent b9d2063 commit 3584922
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def remote_server?

def remote_server_jar
if ENV['DOWNLOAD_SERVER']
@remote_server_jar ||= "#{root.join('rb/selenium-server-standalone').to_s}-#{Selenium::Server.latest}.jar".to_s
@remote_server_jar ||= "#{root.join('rb/selenium-server-standalone').to_s}-#{Selenium::Server.latest}.jar"
@remote_server_jar = root.join("rb/#{Selenium::Server.download(:latest)}").to_s unless File.exist? @remote_server_jar
else
@remote_server_jar ||= root.join('buck-out/gen/java/server/src/org/openqa/grid/selenium/selenium.jar').to_s
Expand Down Expand Up @@ -130,7 +130,9 @@ def url_for(filename)
end

def root
@root ||= Pathname.new('../../../../../../../').expand_path(__FILE__)
# prefer #realpath over #expand_path to avoid problems with UNC
# see https://bugs.ruby-lang.org/issues/13515
@root ||= Pathname.new('../../../../../../../').realpath(__FILE__)
end

def remote_capabilities
Expand Down

0 comments on commit 3584922

Please sign in to comment.