Skip to content

Commit 1f94a76

Browse files
committed
Merge pull request #7 from boutil/master
use :create_additions to force creation of Ruby objects from JSON
2 parents f5c17cc + 60250a9 commit 1f94a76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/cookie_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
end
164164
it "should automatically deserialize to a cookie" do
165165
json = "{\"json_class\":\"CookieJar::Cookie\",\"name\":\"foo\",\"value\":\"bar\",\"domain\":\"localhost.local\",\"path\":\"\\/\",\"created_at\":\"2009-09-11 12:51:03 -0600\",\"expiry\":\"2009-09-11 19:10:00 -0600\",\"secure\":true}"
166-
c = JSON.parse json
166+
c = JSON.parse json, :create_additions => true
167167
c.should be_a Cookie
168168
CookieValidation.validate_cookie 'https://localhost/', c
169169
end

test/jar_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223

224224
it "should automatically deserialize to a jar" do
225225
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}]}"
226-
jar = JSON.parse json
226+
jar = JSON.parse json, :create_additions => true
227227
jar.get_cookies('https://localhost/').should have(1).items
228228
end
229229
end

0 commit comments

Comments
 (0)