mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Clean up session namespace implementation.
This commit is contained in:
parent
fbe8bfec0b
commit
14731d2d1b
1 changed files with 1 additions and 11 deletions
|
@ -57,13 +57,7 @@ module Capybara
|
||||||
# @return [Capybara::Session] The currently used session
|
# @return [Capybara::Session] The currently used session
|
||||||
#
|
#
|
||||||
def current_session
|
def current_session
|
||||||
if session_name == :default
|
session_pool["#{current_driver}:#{session_name}:#{app.object_id}"] ||= Capybara::Session.new(current_driver, app)
|
||||||
namespace = session_namespace
|
|
||||||
else
|
|
||||||
namespace = "#{session_namespace}:#{session_name}"
|
|
||||||
end
|
|
||||||
|
|
||||||
session_pool[namespace] ||= Capybara::Session.new(current_driver, app)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -99,10 +93,6 @@ module Capybara
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def session_namespace
|
|
||||||
"#{current_driver}#{app.object_id}"
|
|
||||||
end
|
|
||||||
|
|
||||||
def session_pool
|
def session_pool
|
||||||
@session_pool ||= {}
|
@session_pool ||= {}
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue