From 378ea5d6134c323bb5a54c19c467a15a7feb3086 Mon Sep 17 00:00:00 2001 From: Titus Fortner Date: Tue, 15 Sep 2015 23:53:50 -0700 Subject: [PATCH] rb - update file loading to allow tests to be run from relative directories --- .../selenium/webdriver/app_cache_spec.rb | 2 +- .../integration/selenium/webdriver/driver_spec.rb | 2 +- .../selenium/webdriver/element_spec.rb | 2 +- .../integration/selenium/webdriver/error_spec.rb | 2 +- .../selenium/webdriver/keyboard_spec.rb | 2 +- .../selenium/webdriver/location_spec.rb | 2 +- .../integration/selenium/webdriver/mouse_spec.rb | 2 +- .../selenium/webdriver/navigation_spec.rb | 2 +- .../selenium/webdriver/network_connection_spec.rb | 2 +- .../selenium/webdriver/options_spec.rb | 2 +- .../integration/selenium/webdriver/spec_helper.rb | 2 +- .../selenium/webdriver/spec_support.rb | 15 ++++----------- .../selenium/webdriver/sql_database_spec.rb | 2 +- .../selenium/webdriver/storage_spec.rb | 2 +- .../selenium/webdriver/target_locator_spec.rb | 2 +- .../selenium/webdriver/timeout_spec.rb | 2 +- .../integration/selenium/webdriver/touch_spec.rb | 2 +- .../integration/selenium/webdriver/window_spec.rb | 2 +- .../integration/selenium/webdriver/zipper_spec.rb | 2 +- rb/spec/unit/selenium/client/base_spec.rb | 2 +- rb/spec/unit/selenium/client/extensions_spec.rb | 2 +- rb/spec/unit/selenium/client/idiomatic_spec.rb | 2 +- .../client/javascript_expression_builder_spec.rb | 2 +- rb/spec/unit/selenium/client/protocol_spec.rb | 2 +- .../unit/selenium/client/selenium_helper_spec.rb | 2 +- .../selenium/webdriver/action_builder_spec.rb | 2 +- rb/spec/unit/selenium/webdriver/error_spec.rb | 2 +- .../unit/selenium/webdriver/file_reaper_spec.rb | 2 +- rb/spec/unit/selenium/webdriver/log_entry_spec.rb | 2 +- rb/spec/unit/selenium/webdriver/proxy_spec.rb | 2 +- .../selenium/webdriver/search_context_spec.rb | 2 +- .../unit/selenium/webdriver/socket_poller_spec.rb | 2 +- rb/spec/unit/selenium/webdriver/wait_spec.rb | 2 +- 33 files changed, 36 insertions(+), 43 deletions(-) diff --git a/rb/spec/integration/selenium/webdriver/app_cache_spec.rb b/rb/spec/integration/selenium/webdriver/app_cache_spec.rb index ce4ef41c05a14..f2129f8965ee5 100644 --- a/rb/spec/integration/selenium/webdriver/app_cache_spec.rb +++ b/rb/spec/integration/selenium/webdriver/app_cache_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium::WebDriver::DriverExtensions diff --git a/rb/spec/integration/selenium/webdriver/driver_spec.rb b/rb/spec/integration/selenium/webdriver/driver_spec.rb index 1901b28510e9e..0fae2e4f8efa7 100644 --- a/rb/spec/integration/selenium/webdriver/driver_spec.rb +++ b/rb/spec/integration/selenium/webdriver/driver_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Driver" do it "should get the page title" do diff --git a/rb/spec/integration/selenium/webdriver/element_spec.rb b/rb/spec/integration/selenium/webdriver/element_spec.rb index 63552fbe3d2ee..ae74f6b1d9c3e 100644 --- a/rb/spec/integration/selenium/webdriver/element_spec.rb +++ b/rb/spec/integration/selenium/webdriver/element_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Element" do diff --git a/rb/spec/integration/selenium/webdriver/error_spec.rb b/rb/spec/integration/selenium/webdriver/error_spec.rb index 1c8b53c757201..e2428999a406d 100644 --- a/rb/spec/integration/selenium/webdriver/error_spec.rb +++ b/rb/spec/integration/selenium/webdriver/error_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::WebDriver::Error do diff --git a/rb/spec/integration/selenium/webdriver/keyboard_spec.rb b/rb/spec/integration/selenium/webdriver/keyboard_spec.rb index 0baf28a899265..54b77cf4a4985 100644 --- a/rb/spec/integration/selenium/webdriver/keyboard_spec.rb +++ b/rb/spec/integration/selenium/webdriver/keyboard_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/integration/selenium/webdriver/location_spec.rb b/rb/spec/integration/selenium/webdriver/location_spec.rb index b61456f7d920c..5468a81af9302 100644 --- a/rb/spec/integration/selenium/webdriver/location_spec.rb +++ b/rb/spec/integration/selenium/webdriver/location_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium::WebDriver::DriverExtensions describe HasLocation do diff --git a/rb/spec/integration/selenium/webdriver/mouse_spec.rb b/rb/spec/integration/selenium/webdriver/mouse_spec.rb index 5eb660ed0b26f..dc44a23704346 100644 --- a/rb/spec/integration/selenium/webdriver/mouse_spec.rb +++ b/rb/spec/integration/selenium/webdriver/mouse_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/integration/selenium/webdriver/navigation_spec.rb b/rb/spec/integration/selenium/webdriver/navigation_spec.rb index 7ed9cd9c15953..9e810d459f9a5 100644 --- a/rb/spec/integration/selenium/webdriver/navigation_spec.rb +++ b/rb/spec/integration/selenium/webdriver/navigation_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Navigation" do let(:wait) { Selenium::WebDriver::Wait.new :timeout => 10 } diff --git a/rb/spec/integration/selenium/webdriver/network_connection_spec.rb b/rb/spec/integration/selenium/webdriver/network_connection_spec.rb index d53879b8f3dbc..8555059f12a00 100644 --- a/rb/spec/integration/selenium/webdriver/network_connection_spec.rb +++ b/rb/spec/integration/selenium/webdriver/network_connection_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium::WebDriver::DriverExtensions describe HasNetworkConnection do diff --git a/rb/spec/integration/selenium/webdriver/options_spec.rb b/rb/spec/integration/selenium/webdriver/options_spec.rb index a0307c50a65d9..32b36a766c6c3 100644 --- a/rb/spec/integration/selenium/webdriver/options_spec.rb +++ b/rb/spec/integration/selenium/webdriver/options_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/integration/selenium/webdriver/spec_helper.rb b/rb/spec/integration/selenium/webdriver/spec_helper.rb index 8fc4a84b66dc8..3d0a562a4f6da 100644 --- a/rb/spec/integration/selenium/webdriver/spec_helper.rb +++ b/rb/spec/integration/selenium/webdriver/spec_helper.rb @@ -23,7 +23,7 @@ require 'ci/reporter/rspec' require 'selenium-webdriver' -require 'selenium/webdriver/spec_support' +require_relative 'spec_support' include Selenium diff --git a/rb/spec/integration/selenium/webdriver/spec_support.rb b/rb/spec/integration/selenium/webdriver/spec_support.rb index 47a77298ff8a1..5fc3df5242ef8 100644 --- a/rb/spec/integration/selenium/webdriver/spec_support.rb +++ b/rb/spec/integration/selenium/webdriver/spec_support.rb @@ -19,14 +19,7 @@ require 'pathname' require 'selenium/server' -require 'selenium/webdriver/spec_support/test_environment' -require 'selenium/webdriver/spec_support/guards' -require 'selenium/webdriver/spec_support/helpers' - -module Selenium - module WebDriver - module SpecSupport - autoload :RackServer, 'selenium/webdriver/spec_support/rack_server' - end - end -end \ No newline at end of file +require_relative 'spec_support/test_environment' +require_relative 'spec_support/guards' +require_relative 'spec_support/helpers' +require_relative 'spec_support/rack_server' diff --git a/rb/spec/integration/selenium/webdriver/sql_database_spec.rb b/rb/spec/integration/selenium/webdriver/sql_database_spec.rb index 0dc6da9d43b30..636c8855f99e3 100644 --- a/rb/spec/integration/selenium/webdriver/sql_database_spec.rb +++ b/rb/spec/integration/selenium/webdriver/sql_database_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Driver" do context "sql database" do diff --git a/rb/spec/integration/selenium/webdriver/storage_spec.rb b/rb/spec/integration/selenium/webdriver/storage_spec.rb index 0b42050c9793b..a6bf9339358c5 100644 --- a/rb/spec/integration/selenium/webdriver/storage_spec.rb +++ b/rb/spec/integration/selenium/webdriver/storage_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium::WebDriver::DriverExtensions describe HasWebStorage do diff --git a/rb/spec/integration/selenium/webdriver/target_locator_spec.rb b/rb/spec/integration/selenium/webdriver/target_locator_spec.rb index 2fe92464028a7..922d4999c0fd2 100644 --- a/rb/spec/integration/selenium/webdriver/target_locator_spec.rb +++ b/rb/spec/integration/selenium/webdriver/target_locator_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Selenium::WebDriver::TargetLocator" do let(:wait) { Selenium::WebDriver::Wait.new } diff --git a/rb/spec/integration/selenium/webdriver/timeout_spec.rb b/rb/spec/integration/selenium/webdriver/timeout_spec.rb index e42676a468b53..9fefa625b3bd2 100644 --- a/rb/spec/integration/selenium/webdriver/timeout_spec.rb +++ b/rb/spec/integration/selenium/webdriver/timeout_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "Timeouts" do diff --git a/rb/spec/integration/selenium/webdriver/touch_spec.rb b/rb/spec/integration/selenium/webdriver/touch_spec.rb index 3d2720231f1fc..6b327d76a263b 100644 --- a/rb/spec/integration/selenium/webdriver/touch_spec.rb +++ b/rb/spec/integration/selenium/webdriver/touch_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium::WebDriver::DriverExtensions describe HasTouchScreen do diff --git a/rb/spec/integration/selenium/webdriver/window_spec.rb b/rb/spec/integration/selenium/webdriver/window_spec.rb index 97513cfbffd14..3faf81f1d9a08 100644 --- a/rb/spec/integration/selenium/webdriver/window_spec.rb +++ b/rb/spec/integration/selenium/webdriver/window_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/integration/selenium/webdriver/zipper_spec.rb b/rb/spec/integration/selenium/webdriver/zipper_spec.rb index 9932cdf1c7694..64f0fbaa67719 100644 --- a/rb/spec/integration/selenium/webdriver/zipper_spec.rb +++ b/rb/spec/integration/selenium/webdriver/zipper_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/client/base_spec.rb b/rb/spec/unit/selenium/client/base_spec.rb index ad8d89d99ec3c..a16fe2fe8e054 100644 --- a/rb/spec/unit/selenium/client/base_spec.rb +++ b/rb/spec/unit/selenium/client/base_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::Base do diff --git a/rb/spec/unit/selenium/client/extensions_spec.rb b/rb/spec/unit/selenium/client/extensions_spec.rb index 014d9750ec33b..86e92d9206e95 100644 --- a/rb/spec/unit/selenium/client/extensions_spec.rb +++ b/rb/spec/unit/selenium/client/extensions_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::Extensions do class ExtensionsClient diff --git a/rb/spec/unit/selenium/client/idiomatic_spec.rb b/rb/spec/unit/selenium/client/idiomatic_spec.rb index 10488d00f0c67..bccc6afc2a5d8 100644 --- a/rb/spec/unit/selenium/client/idiomatic_spec.rb +++ b/rb/spec/unit/selenium/client/idiomatic_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::Idiomatic do class IdiomaticClient diff --git a/rb/spec/unit/selenium/client/javascript_expression_builder_spec.rb b/rb/spec/unit/selenium/client/javascript_expression_builder_spec.rb index 5891d124473d2..26528fc973fa1 100644 --- a/rb/spec/unit/selenium/client/javascript_expression_builder_spec.rb +++ b/rb/spec/unit/selenium/client/javascript_expression_builder_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::JavascriptExpressionBuilder do def builder(*args) diff --git a/rb/spec/unit/selenium/client/protocol_spec.rb b/rb/spec/unit/selenium/client/protocol_spec.rb index f481dc180cb7c..5445a2a009986 100644 --- a/rb/spec/unit/selenium/client/protocol_spec.rb +++ b/rb/spec/unit/selenium/client/protocol_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::Protocol do class ProtocolClient diff --git a/rb/spec/unit/selenium/client/selenium_helper_spec.rb b/rb/spec/unit/selenium/client/selenium_helper_spec.rb index 9471f1a67f3f5..e993c51805b9d 100644 --- a/rb/spec/unit/selenium/client/selenium_helper_spec.rb +++ b/rb/spec/unit/selenium/client/selenium_helper_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::Client::SeleniumHelper do class SeleniumHelperClass diff --git a/rb/spec/unit/selenium/webdriver/action_builder_spec.rb b/rb/spec/unit/selenium/webdriver/action_builder_spec.rb index 5759f338460be..84304d4accf94 100644 --- a/rb/spec/unit/selenium/webdriver/action_builder_spec.rb +++ b/rb/spec/unit/selenium/webdriver/action_builder_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe Selenium::WebDriver::ActionBuilder do let(:bridge) { double("Bridge").as_null_object } diff --git a/rb/spec/unit/selenium/webdriver/error_spec.rb b/rb/spec/unit/selenium/webdriver/error_spec.rb index 408eaee5f06a8..9f66a00341415 100644 --- a/rb/spec/unit/selenium/webdriver/error_spec.rb +++ b/rb/spec/unit/selenium/webdriver/error_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/webdriver/file_reaper_spec.rb b/rb/spec/unit/selenium/webdriver/file_reaper_spec.rb index d8cec261e8902..c3bdfa04386a8 100644 --- a/rb/spec/unit/selenium/webdriver/file_reaper_spec.rb +++ b/rb/spec/unit/selenium/webdriver/file_reaper_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/webdriver/log_entry_spec.rb b/rb/spec/unit/selenium/webdriver/log_entry_spec.rb index 278decaa97052..2ffab3e441645 100644 --- a/rb/spec/unit/selenium/webdriver/log_entry_spec.rb +++ b/rb/spec/unit/selenium/webdriver/log_entry_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/webdriver/proxy_spec.rb b/rb/spec/unit/selenium/webdriver/proxy_spec.rb index da1c2da32a37b..513497162aca4 100755 --- a/rb/spec/unit/selenium/webdriver/proxy_spec.rb +++ b/rb/spec/unit/selenium/webdriver/proxy_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/webdriver/search_context_spec.rb b/rb/spec/unit/selenium/webdriver/search_context_spec.rb index 19dabab891d15..b232cbe84c942 100644 --- a/rb/spec/unit/selenium/webdriver/search_context_spec.rb +++ b/rb/spec/unit/selenium/webdriver/search_context_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' describe "SearchContext" do class TestSearchContext diff --git a/rb/spec/unit/selenium/webdriver/socket_poller_spec.rb b/rb/spec/unit/selenium/webdriver/socket_poller_spec.rb index 8979afa935c7e..13a0b36eded06 100644 --- a/rb/spec/unit/selenium/webdriver/socket_poller_spec.rb +++ b/rb/spec/unit/selenium/webdriver/socket_poller_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver diff --git a/rb/spec/unit/selenium/webdriver/wait_spec.rb b/rb/spec/unit/selenium/webdriver/wait_spec.rb index d654bf5b9e98b..c6438be64e54e 100644 --- a/rb/spec/unit/selenium/webdriver/wait_spec.rb +++ b/rb/spec/unit/selenium/webdriver/wait_spec.rb @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -require File.expand_path("../spec_helper", __FILE__) +require_relative 'spec_helper' module Selenium module WebDriver