diff --git a/lib/capybara.rb b/lib/capybara.rb index 50446f6f..efa25456 100644 --- a/lib/capybara.rb +++ b/lib/capybara.rb @@ -14,8 +14,6 @@ module Capybara class NotSupportedByDriverError < CapybaraError; end class InfiniteRedirectError < CapybaraError; end - EMPTY_HTML_FILE_PATH = File.expand_path('./capybara/empty.html', File.dirname(__FILE__)) - class << self attr_accessor :asset_host, :app_host, :run_server, :default_host, :always_include_port attr_accessor :server_port, :exact, :match, :exact_options, :visible_text_only diff --git a/lib/capybara/empty.html b/lib/capybara/empty.html deleted file mode 100644 index 71572691..00000000 --- a/lib/capybara/empty.html +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/lib/capybara/selenium/driver.rb b/lib/capybara/selenium/driver.rb index 3f815d3b..73ae4938 100644 --- a/lib/capybara/selenium/driver.rb +++ b/lib/capybara/selenium/driver.rb @@ -97,9 +97,7 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base # to about:blank, so we rescue this error and do nothing # instead. end - uri = URI(Capybara::EMPTY_HTML_FILE_PATH) - uri.scheme = "file" - @browser.navigate.to(uri.to_s) + @browser.navigate.to("about:blank") end end diff --git a/lib/capybara/spec/session/reset_session_spec.rb b/lib/capybara/spec/session/reset_session_spec.rb index f8ae4e0f..98345be3 100644 --- a/lib/capybara/spec/session/reset_session_spec.rb +++ b/lib/capybara/spec/session/reset_session_spec.rb @@ -16,17 +16,8 @@ Capybara::SpecHelper.spec '#reset_session!' do @session.current_path.should == '/foo' @session.reset_session! - [ - ->(v) { v == nil }, - ->(v) { v == '' }, - ->(v) { v == 'about:blank' }, - ->(v) { v.end_with? Capybara::EMPTY_HTML_FILE_PATH } # allow file:// protocol - ].any? { |p| p.(@session.current_url) }.should be_true - [ - ->(v) { v == '' }, - ->(v) { v == nil }, - ->(v) { v == Capybara::EMPTY_HTML_FILE_PATH } - ].any? { |p| p.(@session.current_path) }.should be_true + [nil, '', 'about:blank'].should include(@session.current_url) + ['', nil].should include(@session.current_path) @session.current_host.should be_nil end