show_me_the_cookies 5.0.1 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +15 -1
- data/Gemfile +1 -2
- data/Gemfile.lock +48 -49
- data/README.md +2 -2
- data/lib/show_me_the_cookies/adapters/rack_test.rb +1 -1
- data/lib/show_me_the_cookies/version.rb +1 -1
- data/lib/show_me_the_cookies.rb +0 -2
- data/show_me_the_cookies.gemspec +0 -2
- data/spec/shared_examples_for_api.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +4 -16
- data/lib/show_me_the_cookies/adapters/poltergeist.rb +0 -50
- data/spec/drivers/poltergeist_spec.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 733e1bf58e719ff4734c5ab7992c0d2f450e20e4bd4adb9e561660586e365f81
|
4
|
+
data.tar.gz: 56bbc390e84918eae097eb1a6b877197dd52a89ff34ed2f3f5550f65664bbdeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1036a7874266a20ce068f0be468a9a1d524aeca7557398ded8398c63964d3fc8c6e7ae473ba9f472bb0fb05f94e95802777d354580aed5d3e3772507e297b56a
|
7
|
+
data.tar.gz: 3ce7610725681a70d5e49c6b419e13f734b29b5e6f9a002170ade038f1d24554d2c44f54e2f30001fedde41420a493fcad8fce4cc8b6d85aadf588628773882c
|
data/Changelog.md
CHANGED
@@ -1,6 +1,20 @@
|
|
1
|
+
# 6.0.0
|
2
|
+
|
3
|
+
## Breaking change: Poltergeist removed
|
4
|
+
|
5
|
+
It's been obsolete for a while now. If you still need it, you can copy the driver / registration into your app's test code.
|
6
|
+
|
7
|
+
## Fix incompatibility with rack-test 2.0
|
8
|
+
|
9
|
+
Thanks juno. https://github.com/nruth/show_me_the_cookies/pull/64
|
10
|
+
This will likely break rack-test 1.x as it uses new methods/API to get the cookie store.
|
11
|
+
To restore that, override the changed code in your test setup, or register a custom
|
12
|
+
rack-test1 driver based on the old code.
|
13
|
+
|
1
14
|
# 5.0.1
|
2
15
|
|
3
|
-
##
|
16
|
+
## Gem development dependencies
|
17
|
+
|
4
18
|
chromedriver-helper -> webdrivers. Bundler -> 2.0.2. Should not affect your app.
|
5
19
|
|
6
20
|
# 5.0
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,74 +1,74 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
show_me_the_cookies (
|
4
|
+
show_me_the_cookies (6.0.0)
|
5
5
|
capybara (>= 2, < 4)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
addressable (2.
|
10
|
+
addressable (2.8.0)
|
11
11
|
public_suffix (>= 2.0.2, < 5.0)
|
12
|
-
capybara (3.
|
12
|
+
capybara (3.37.1)
|
13
13
|
addressable
|
14
|
+
matrix
|
14
15
|
mini_mime (>= 0.1.3)
|
15
16
|
nokogiri (~> 1.8)
|
16
17
|
rack (>= 1.6.0)
|
17
18
|
rack-test (>= 0.6.3)
|
18
|
-
regexp_parser (
|
19
|
+
regexp_parser (>= 1.5, < 3.0)
|
19
20
|
xpath (~> 3.2)
|
20
|
-
childprocess (
|
21
|
-
|
22
|
-
|
23
|
-
mini_mime (1.
|
24
|
-
mini_portile2 (2.
|
21
|
+
childprocess (4.1.0)
|
22
|
+
diff-lcs (1.5.0)
|
23
|
+
matrix (0.4.2)
|
24
|
+
mini_mime (1.1.2)
|
25
|
+
mini_portile2 (2.8.0)
|
25
26
|
mustermann (1.1.1)
|
26
27
|
ruby2_keywords (~> 0.0.1)
|
27
|
-
nokogiri (1.
|
28
|
-
mini_portile2 (~> 2.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
rack (2.2.2)
|
35
|
-
rack-protection (2.0.8.1)
|
28
|
+
nokogiri (1.13.7)
|
29
|
+
mini_portile2 (~> 2.8.0)
|
30
|
+
racc (~> 1.4)
|
31
|
+
public_suffix (4.0.7)
|
32
|
+
racc (1.6.0)
|
33
|
+
rack (2.2.4)
|
34
|
+
rack-protection (2.2.0)
|
36
35
|
rack
|
37
|
-
rack-test (
|
38
|
-
rack (>= 1.
|
39
|
-
rake (13.0.
|
40
|
-
regexp_parser (
|
41
|
-
|
42
|
-
|
43
|
-
rspec-
|
44
|
-
rspec-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
rack-test (2.0.2)
|
37
|
+
rack (>= 1.3)
|
38
|
+
rake (13.0.6)
|
39
|
+
regexp_parser (2.5.0)
|
40
|
+
rexml (3.2.5)
|
41
|
+
rspec (3.11.0)
|
42
|
+
rspec-core (~> 3.11.0)
|
43
|
+
rspec-expectations (~> 3.11.0)
|
44
|
+
rspec-mocks (~> 3.11.0)
|
45
|
+
rspec-core (3.11.0)
|
46
|
+
rspec-support (~> 3.11.0)
|
47
|
+
rspec-expectations (3.11.0)
|
48
48
|
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
-
rspec-support (~> 3.
|
50
|
-
rspec-mocks (3.
|
49
|
+
rspec-support (~> 3.11.0)
|
50
|
+
rspec-mocks (3.11.1)
|
51
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
52
|
-
rspec-support (~> 3.
|
53
|
-
rspec-support (3.
|
54
|
-
ruby2_keywords (0.0.
|
55
|
-
rubyzip (2.3.
|
56
|
-
selenium-webdriver (3.
|
57
|
-
childprocess (>= 0.5, <
|
58
|
-
|
59
|
-
|
52
|
+
rspec-support (~> 3.11.0)
|
53
|
+
rspec-support (3.11.0)
|
54
|
+
ruby2_keywords (0.0.5)
|
55
|
+
rubyzip (2.3.2)
|
56
|
+
selenium-webdriver (4.3.0)
|
57
|
+
childprocess (>= 0.5, < 5.0)
|
58
|
+
rexml (~> 3.2, >= 3.2.5)
|
59
|
+
rubyzip (>= 1.2.2, < 3.0)
|
60
|
+
websocket (~> 1.0)
|
61
|
+
sinatra (2.2.0)
|
60
62
|
mustermann (~> 1.0)
|
61
|
-
rack (~> 2.
|
62
|
-
rack-protection (= 2.0
|
63
|
+
rack (~> 2.2)
|
64
|
+
rack-protection (= 2.2.0)
|
63
65
|
tilt (~> 2.0)
|
64
66
|
tilt (2.0.10)
|
65
|
-
webdrivers (
|
67
|
+
webdrivers (5.0.0)
|
66
68
|
nokogiri (~> 1.6)
|
67
69
|
rubyzip (>= 1.3.0)
|
68
|
-
selenium-webdriver (
|
69
|
-
websocket
|
70
|
-
websocket-extensions (>= 0.1.0)
|
71
|
-
websocket-extensions (0.1.4)
|
70
|
+
selenium-webdriver (~> 4.0)
|
71
|
+
websocket (1.2.9)
|
72
72
|
xpath (3.2.0)
|
73
73
|
nokogiri (~> 1.8)
|
74
74
|
|
@@ -76,13 +76,12 @@ PLATFORMS
|
|
76
76
|
ruby
|
77
77
|
|
78
78
|
DEPENDENCIES
|
79
|
-
poltergeist
|
80
79
|
rake
|
81
80
|
rspec (~> 3.0)
|
82
81
|
selenium-webdriver
|
83
82
|
show_me_the_cookies!
|
84
83
|
sinatra
|
85
|
-
webdrivers
|
84
|
+
webdrivers
|
86
85
|
|
87
86
|
BUNDLED WITH
|
88
|
-
2.
|
87
|
+
2.2.16
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Show me the cookies
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://semaphoreci.com/api/v1/projects/9a0dc444-fd04-4187-95a7-7a07abecbad7/201807/shields_badge.png)](https://semaphoreci.com/nruth/show_me_the_cookies) [![Gem Version](https://badge.fury.io/rb/show_me_the_cookies.svg)](http://badge.fury.io/rb/show_me_the_cookies)
|
4
4
|
|
5
5
|
Some helpers for poking around at your Capybara driven browser's cookies in integration tests.
|
6
6
|
|
7
|
-
Provides drivers for rack-test
|
7
|
+
Provides drivers for rack-test and [selenium-webdriver](https://rubygems.org/gems/selenium-webdriver).
|
8
8
|
|
9
9
|
You can add new drivers to your application by implementing an adapter class and calling ShowMeTheCookies.register_adapter in your test code (e.g. a spec/support file). But in that case you might prefer to skip this gem and use your driver's api directly.
|
10
10
|
|
data/lib/show_me_the_cookies.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module ShowMeTheCookies
|
2
2
|
require 'show_me_the_cookies/adapters/rack_test'
|
3
|
-
require 'show_me_the_cookies/adapters/poltergeist'
|
4
3
|
require 'show_me_the_cookies/adapters/selenium'
|
5
4
|
require 'show_me_the_cookies/adapters/selenium_chrome'
|
6
5
|
|
@@ -22,7 +21,6 @@ module ShowMeTheCookies
|
|
22
21
|
register_adapter(:selenium_chrome, ShowMeTheCookies::SeleniumChrome)
|
23
22
|
register_adapter(:selenium_chrome_headless, ShowMeTheCookies::SeleniumChrome)
|
24
23
|
register_adapter(:rack_test, ShowMeTheCookies::RackTest)
|
25
|
-
register_adapter(:poltergeist, ShowMeTheCookies::Poltergeist)
|
26
24
|
|
27
25
|
# puts a string summary of the cookie
|
28
26
|
def show_me_the_cookie(cookie_name)
|
data/show_me_the_cookies.gemspec
CHANGED
@@ -14,8 +14,6 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.licenses = ["MIT"]
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
17
|
s.require_paths = ["lib"]
|
20
18
|
s.add_dependency('capybara', ['>= 2', '< 4'])
|
21
19
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: show_me_the_cookies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Rutherford
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -44,14 +44,12 @@ files:
|
|
44
44
|
- README.md
|
45
45
|
- Rakefile
|
46
46
|
- lib/show_me_the_cookies.rb
|
47
|
-
- lib/show_me_the_cookies/adapters/poltergeist.rb
|
48
47
|
- lib/show_me_the_cookies/adapters/rack_test.rb
|
49
48
|
- lib/show_me_the_cookies/adapters/selenium.rb
|
50
49
|
- lib/show_me_the_cookies/adapters/selenium_chrome.rb
|
51
50
|
- lib/show_me_the_cookies/version.rb
|
52
51
|
- show_me_the_cookies.gemspec
|
53
52
|
- spec/app/set_cookie.rb
|
54
|
-
- spec/drivers/poltergeist_spec.rb
|
55
53
|
- spec/drivers/rack-test_spec.rb
|
56
54
|
- spec/drivers/selenium_chrome_headless_spec.rb
|
57
55
|
- spec/drivers/selenium_chrome_spec.rb
|
@@ -79,18 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
77
|
- !ruby/object:Gem::Version
|
80
78
|
version: '0'
|
81
79
|
requirements: []
|
82
|
-
rubygems_version: 3.1.
|
80
|
+
rubygems_version: 3.1.6
|
83
81
|
signing_key:
|
84
82
|
specification_version: 4
|
85
83
|
summary: Cookie manipulation for Capybara drivers
|
86
|
-
test_files:
|
87
|
-
- spec/app/set_cookie.rb
|
88
|
-
- spec/drivers/poltergeist_spec.rb
|
89
|
-
- spec/drivers/rack-test_spec.rb
|
90
|
-
- spec/drivers/selenium_chrome_headless_spec.rb
|
91
|
-
- spec/drivers/selenium_chrome_spec.rb
|
92
|
-
- spec/drivers/selenium_headless_spec.rb
|
93
|
-
- spec/drivers/selenium_spec.rb
|
94
|
-
- spec/drivers/unknown_driver_spec.rb
|
95
|
-
- spec/shared_examples_for_api.rb
|
96
|
-
- spec/spec_helper.rb
|
84
|
+
test_files: []
|
@@ -1,50 +0,0 @@
|
|
1
|
-
module ShowMeTheCookies
|
2
|
-
class Poltergeist
|
3
|
-
def initialize(driver)
|
4
|
-
@browser = driver.browser
|
5
|
-
@driver = driver
|
6
|
-
end
|
7
|
-
|
8
|
-
def get_me_the_cookie(name)
|
9
|
-
cookie = cookies_hash[name.to_s]
|
10
|
-
translate(cookie) unless cookie.nil?
|
11
|
-
end
|
12
|
-
|
13
|
-
def get_me_the_cookies
|
14
|
-
cookies_hash.values.map(&method(:translate))
|
15
|
-
end
|
16
|
-
|
17
|
-
def expire_cookies
|
18
|
-
cookies_hash.each do |name, cookie|
|
19
|
-
delete_cookie(name) if (cookie.expires rescue nil).nil?
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def delete_cookie(name)
|
24
|
-
@browser.remove_cookie(name.to_s)
|
25
|
-
end
|
26
|
-
|
27
|
-
def create_cookie(name, value, options)
|
28
|
-
# see: https://github.com/jonleighton/poltergeist#manipulating-cookies
|
29
|
-
@driver.set_cookie(name, value, options)
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def cookies_hash
|
35
|
-
@browser.cookies
|
36
|
-
end
|
37
|
-
|
38
|
-
def translate(cookie)
|
39
|
-
{
|
40
|
-
:name => cookie.name,
|
41
|
-
:domain => cookie.domain,
|
42
|
-
:value => cookie.value,
|
43
|
-
:expires => (cookie.expires rescue nil),
|
44
|
-
:path => cookie.path,
|
45
|
-
:secure => cookie.secure?,
|
46
|
-
:httponly => cookie.httponly?
|
47
|
-
}
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'shared_examples_for_api'
|
3
|
-
require 'capybara/poltergeist'
|
4
|
-
|
5
|
-
RSpec.describe 'Poltergeist', type: :feature do
|
6
|
-
before(:each) do
|
7
|
-
Capybara.current_driver = :poltergeist
|
8
|
-
end
|
9
|
-
|
10
|
-
describe 'the testing rig' do
|
11
|
-
it 'should load the sinatra app' do
|
12
|
-
visit '/'
|
13
|
-
expect(page).to have_content('Cookie setter ready')
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe 'get_me_the_cookie' do
|
18
|
-
it 'reads httponly option' do
|
19
|
-
visit '/set_httponly/foo/bar'
|
20
|
-
expect(get_me_the_cookie('foo')).to include(
|
21
|
-
name: 'foo', value: 'bar', httponly: true
|
22
|
-
)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
it_behaves_like 'the API'
|
27
|
-
end
|