capybara-typhoeus 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55d6e90d7b65fd3c7183b989c74e6532103382b684bda3b647e52d1dbfe04368
4
- data.tar.gz: b1e22d5b2c32f7ac8ae85b6d13f05b8b16ab9ef2cc574368ba305824b14db16b
3
+ metadata.gz: 52f3b94df91d387fd0497c1a1f774c4f4df7375e6eeee1b5949abfbdeb70ee24
4
+ data.tar.gz: 7c06afed2246fac7ea2382be5edbeaf60bedb24a385a6249c78e2c9fb5e44072
5
5
  SHA512:
6
- metadata.gz: 82ae5e119a7996fac56c8d24ac5551cd35aa466232e3f58a02cd4f1eec732ebafb096cd8134be1f37ae8cb1fcad0f1997279e8941f30e071288da16c682a371d
7
- data.tar.gz: 4df5e80af597d8c6d90443cff1e705cc6aa51c394dee07b4c646d2a34b01f32a21029c2a5039a8f12d878095a715b1d5858d48fe90cb9b25f4823ecc166833b4
6
+ metadata.gz: 2c47183792966d74e52b71add37aba8c7300fcf877cc24a5a898e9aa65507bea423c20d2ce4cbc6805376aa155d441ecffff70316019134e7bab2d523dca3238
7
+ data.tar.gz: f96e5e4a1f570d5a4a8f7275abb7e15d8cdd908cf6fb3eb5cbd08485747708dd28d3728e173cf6a8f36a9c19537f49603ffde82873be516c57cd20bec4109e00
@@ -8,12 +8,13 @@ module Capybara
8
8
  autoload :Session, "capybara/typhoeus/session"
9
9
  end
10
10
 
11
- def self.current_session
12
- key = "#{current_driver}:#{session_name}:#{app.object_id}"
13
- session_pool[key] ||= if current_driver==:typhoeus
14
- ::Capybara::Typhoeus::Session.new current_driver, app
15
- else
16
- ::Capybara::Session.new current_driver, app
11
+ def self.session_pool
12
+ @session_pool ||= Hash.new do |hash, name|
13
+ hash[name] = if current_driver==:typhoeus
14
+ ::Capybara::Typhoeus::Session.new(current_driver, app)
15
+ else
16
+ ::Capybara::Session.new(current_driver, app)
17
+ end
17
18
  end
18
19
  end
19
20
  end
@@ -45,10 +45,17 @@ end
45
45
  RSpec.describe Capybara::Typhoeus::Session do
46
46
 
47
47
  context "with typhoeus driver" do
48
+ before { Capybara.current_driver = :typhoeus }
48
49
  let(:session) { TestSessions::TyphoeusTest }
49
50
 
51
+ describe 'Capybara#current_session' do
52
+ it 'should be a typhoeus session' do
53
+ expect(Capybara.current_session).to be_an_instance_of(Capybara::Typhoeus::Session)
54
+ end
55
+ end
56
+
50
57
  describe '#driver' do
51
- it 'should be a rack test driver' do
58
+ it 'should be a typhoeus driver' do
52
59
  expect(session.driver).to be_an_instance_of(Capybara::Typhoeus::Driver)
53
60
  end
54
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara-typhoeus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph HALTER