Reset Capybara.app_host after each spec

Workaround for Capybara integration specs which fail to do the same.
This commit is contained in:
Matthew Horan 2012-11-30 22:12:11 -05:00
parent 8650fe1ff3
commit 615698037e
1 changed files with 5 additions and 4 deletions

View File

@ -17,10 +17,6 @@ $:.detect do |dir|
end
end
RSpec.configure do |c|
c.filter_run_excluding :skip_on_windows => !(RbConfig::CONFIG['host_os'] =~ /mingw32/).nil?
end
require 'capybara/webkit'
connection = Capybara::Webkit::Connection.new(:socket_class => TCPSocket)
$webkit_browser = Capybara::Webkit::Browser.new(connection)
@ -35,6 +31,11 @@ Capybara.register_driver :reusable_webkit do |app|
Capybara::Webkit::Driver.new(app, :browser => $webkit_browser)
end
RSpec.configure do |c|
c.filter_run_excluding :skip_on_windows => !(RbConfig::CONFIG['host_os'] =~ /mingw32/).nil?
c.before { Capybara.app_host = nil }
end
def with_env_vars(vars)
old_env_variables = {}
vars.each do |key, value|