Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Remove rspec-collection_matchers dependency. #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

voxik
Copy link

@voxik voxik commented May 5, 2021

This does not really really add to readability while one less dependency is beneficial.

This does not really really add to readability while one less dependency
is beneficial.
end

it 'should automatically deserialize to a jar' do
json = '{"json_class":"CookieJar::Jar","cookies":[{"name":"foo","value":"bar","domain":"localhost.local","path":"\\/","created_at":"2009-09-11 12:51:03 -0600","expiry":"2028-11-01 12:00:00 GMT","secure":true}]}'
jar = JSON.parse json, create_additions: true
expect(jar.get_cookies('https://localhost/')).to have(1).items
expect(jar.get_cookies('https://localhost/').size).to eql(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end
it 'should deserialize a JSON hash to a jar' do
json = '{"cookies":[{"name":"foo","value":"bar","domain":"localhost.local","path":"\\/","created_at":"2009-09-11 12:51:03 -0600","expiry":"2028-11-01 12:00:00 GMT","secure":true}]}'
hash = JSON.parse json

jar = Jar.json_create hash
expect(jar.get_cookies('https://localhost/')).to have(1).items
expect(jar.get_cookies('https://localhost/').size).to eql(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -208,20 +208,20 @@
array = JSON.parse json

jar = Jar.json_create array
expect(jar.get_cookies('https://localhost/')).to have(1).items
expect(jar.get_cookies('https://localhost/').size).to eql(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -27,7 +27,7 @@
jar.set_cookie 'http://foo.com/', 'bar=baz'
jar.set_cookie 'http://auth.foo.com/', 'foo=bar'
jar.set_cookie 'http://auth.foo.com/', 'auth=135121...;domain=foo.com'
expect(jar.get_cookies('http://foo.com/')).to have(3).items
expect(jar.get_cookies('http://foo.com/').size).to eql(3)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@voxik
Copy link
Author

voxik commented May 5, 2021

Just FTR, it seems that the have is used in the test suite more or less just for historic reasons, since it was available up until RSpec 3.x

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants