-
Notifications
You must be signed in to change notification settings - Fork 71
Remove rspec-collection_matchers dependency. #36
base: master
Are you sure you want to change the base?
Conversation
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Just FTR, it seems that the |
This does not really really add to readability while one less dependency is beneficial.