mechanize 2.7.5 → 2.7.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mechanize might be problematic. Click here for more details.

Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +22 -17
  3. data/CHANGELOG.rdoc +12 -0
  4. data/Gemfile +3 -0
  5. data/README.rdoc +1 -1
  6. data/lib/mechanize/element_matcher.rb +4 -1
  7. data/lib/mechanize/form.rb +62 -14
  8. data/lib/mechanize/form/field.rb +46 -0
  9. data/lib/mechanize/form/multi_select_list.rb +3 -7
  10. data/lib/mechanize/form/option.rb +2 -1
  11. data/lib/mechanize/http/agent.rb +37 -24
  12. data/lib/mechanize/http/content_disposition_parser.rb +4 -1
  13. data/lib/mechanize/http/www_authenticate_parser.rb +1 -1
  14. data/lib/mechanize/page.rb +4 -2
  15. data/lib/mechanize/page/frame.rb +2 -0
  16. data/lib/mechanize/parser.rb +3 -3
  17. data/lib/mechanize/test_case/http_refresh_servlet.rb +1 -2
  18. data/lib/mechanize/test_case/infinite_refresh_servlet.rb +1 -2
  19. data/lib/mechanize/version.rb +1 -1
  20. data/mechanize.gemspec +2 -1
  21. data/test/htdocs/find_link.html +1 -4
  22. data/test/test_mechanize.rb +4 -9
  23. data/test/test_mechanize_cookie.rb +56 -41
  24. data/test/test_mechanize_cookie_jar.rb +27 -6
  25. data/test/test_mechanize_file_response.rb +1 -1
  26. data/test/test_mechanize_form.rb +15 -11
  27. data/test/test_mechanize_form_check_box.rb +10 -0
  28. data/test/test_mechanize_form_encoding.rb +1 -1
  29. data/test/test_mechanize_form_multi_select_list.rb +5 -1
  30. data/test/test_mechanize_http_agent.rb +52 -0
  31. data/test/test_mechanize_http_content_disposition_parser.rb +8 -1
  32. data/test/test_mechanize_http_www_authenticate_parser.rb +8 -0
  33. data/test/test_mechanize_link.rb +19 -0
  34. data/test/test_mechanize_page.rb +28 -0
  35. data/test/test_mechanize_page_image.rb +1 -1
  36. data/test/test_mechanize_page_link.rb +2 -2
  37. data/test/test_mechanize_page_meta_refresh.rb +1 -1
  38. data/test/test_mechanize_parser.rb +12 -2
  39. data/test/test_mechanize_util.rb +1 -1
  40. metadata +10 -16
@@ -141,7 +141,10 @@ class Mechanize::HTTP::ContentDispositionParser
141
141
  text << " "
142
142
  end
143
143
  else
144
- if '"' == @scanner.peek(1) then
144
+ if '\\"' == @scanner.peek(2) then
145
+ @scanner.skip(/\\/)
146
+ text << @scanner.get_byte
147
+ elsif '"' == @scanner.peek(1) then
145
148
  @scanner.get_byte
146
149
  break
147
150
  else
@@ -34,7 +34,7 @@ class Mechanize::HTTP::WWWAuthenticateParser
34
34
  scan_comma_spaces
35
35
  end
36
36
 
37
- next unless scheme
37
+ break unless scheme
38
38
  challenge.scheme = scheme
39
39
 
40
40
  space = spaces
@@ -58,7 +58,7 @@ class Mechanize::Page < Mechanize::File
58
58
  def title
59
59
  @title ||=
60
60
  if doc = parser
61
- title = doc.search('title').inner_text
61
+ title = doc.xpath('string(((/html/head | /html | /head | /)/title)[1])').to_s
62
62
  title.empty? ? nil : title
63
63
  end
64
64
  end
@@ -282,7 +282,9 @@ class Mechanize::Page < Mechanize::File
282
282
  # value.
283
283
  #
284
284
  # :class, :dom_class: selects forms with a #dom_class value that
285
- # matches this value.
285
+ # matches this value. Note that class attribute values are compared
286
+ # literally as string, so forms_with(class: "a") does not match a
287
+ # form with class="a b". Use forms_with(css: "form.a") instead.
286
288
  #
287
289
  # :search: only selects forms matching this selector expression.
288
290
  #
@@ -11,6 +11,8 @@ class Mechanize::Page::Frame < Mechanize::Page::Link
11
11
  attr_reader :text
12
12
  alias :name :text
13
13
 
14
+ attr_reader :node
15
+
14
16
  def initialize(node, mech, referer)
15
17
  super(node, mech, referer)
16
18
  @node = node
@@ -118,13 +118,13 @@ module Mechanize::Parser
118
118
  end
119
119
 
120
120
  # Set the filename
121
- if disposition = @response['content-disposition'] then
121
+ if (disposition = @response['content-disposition'])
122
122
  content_disposition =
123
123
  Mechanize::HTTP::ContentDispositionParser.parse disposition
124
124
 
125
- if content_disposition && content_disposition.filename && content_disposition.filename != '' then
125
+ if content_disposition && content_disposition.filename && content_disposition.filename != ''
126
126
  filename = content_disposition.filename
127
- filename = filename.split(/[\\\/]/).last
127
+ filename = filename.rpartition(/[\\\/]/).last
128
128
  handled = true
129
129
  end
130
130
  end
@@ -3,7 +3,6 @@ class HttpRefreshServlet < WEBrick::HTTPServlet::AbstractServlet
3
3
  res['Content-Type'] = req.query['ct'] || "text/html"
4
4
  refresh_time = req.query['refresh_time'] || 0
5
5
  refresh_url = req.query['refresh_url'] || '/'
6
- res['Refresh'] = " #{refresh_time};url=#{refresh_url}\r\n";
6
+ res['Refresh'] = " #{refresh_time};url=#{refresh_url}";
7
7
  end
8
8
  end
9
-
@@ -4,7 +4,6 @@ class InfiniteRefreshServlet < WEBrick::HTTPServlet::AbstractServlet
4
4
  res['Content-Type'] = req.query['ct'] || "text/html"
5
5
  res.status = req.query['code'] ? req.query['code'].to_i : '302'
6
6
  number = req.query['q'] ? req.query['q'].to_i : 0
7
- res['Refresh'] = "0;url=http://#{address}/infinite_refresh?q=#{number + 1}\r\n";
7
+ res['Refresh'] = "0;url=http://#{address}/infinite_refresh?q=#{number + 1}";
8
8
  end
9
9
  end
10
-
@@ -1,3 +1,3 @@
1
1
  class Mechanize
2
- VERSION = "2.7.5"
2
+ VERSION = "2.7.6"
3
3
  end
@@ -46,11 +46,12 @@ Gem::Specification.new do |spec|
46
46
  spec.required_ruby_version = ">= 1.9.2"
47
47
 
48
48
  spec.add_runtime_dependency "net-http-digest_auth", [ ">= 1.1.1", "~> 1.1" ]
49
- spec.add_runtime_dependency "net-http-persistent", [ ">= 2.5.2", "~> 2.5" ]
50
49
  if RUBY_VERSION >= "2.0"
51
50
  spec.add_runtime_dependency "mime-types", [ ">= 1.17.2" ]
51
+ spec.add_runtime_dependency "net-http-persistent", [ ">= 2.5.2"]
52
52
  else
53
53
  spec.add_runtime_dependency "mime-types", [ ">= 1.17.2", "< 3" ]
54
+ spec.add_runtime_dependency "net-http-persistent", [ ">= 2.5.2", "~> 2.5" ]
54
55
  end
55
56
  spec.add_runtime_dependency "http-cookie", [ "~> 1.0" ]
56
57
  spec.add_runtime_dependency "nokogiri", [ "~> 1.6" ]
@@ -11,13 +11,10 @@
11
11
  <A HREF="http://blargle.com/">blargle</A>
12
12
  <A HREF="http://a.cpan.org/">CPAN A</A>
13
13
  <A HREF="http://b.cpan.org/">CPAN B</A>
14
- <FRAME SRC="foo.html">
15
- <FRAME SRC="bar.html">
16
14
  <A HREF="http://c.cpan.org/" NAME="bongo">CPAN C</A>
17
15
  <A HREF="http://d.cpan.org/">CPAN D</A>
18
16
 
19
17
  <A HREF="http://www.msnbc.com/">MSNBC</A>
20
- <FRAME SRC="http://www.oreilly.com/" NAME="wongo">
21
18
  <A HREF="http://www.cnn.com/">CNN</A>
22
19
  <A HREF="http://www.bbc.co.uk/" NAME="Wilma">BBC</A>
23
20
  <A HREF="http://www.msnbc.com/">News</A>
@@ -35,7 +32,7 @@
35
32
  <!-- new stuff -->
36
33
  <A HREF="http://nowhere.org/" Name="Here">NoWhere</A>
37
34
  <A HREF="http://nowhere.org/padded" Name=" Here "> NoWhere </A>
38
- <A HREF="blongo.html">Blongo!</A>
35
+ <A HREF="form_test.html" class="formtest">Form Test</A>
39
36
  </body>
40
37
  </html>
41
38
 
@@ -943,7 +943,7 @@ but not <a href="/" rel="me nofollow">this</a>!
943
943
  "Content-Disposition: form-data; name=\"userfile1\"; filename=\"#{name}\"",
944
944
  page.body
945
945
  )
946
- assert_send [page.body.bytesize, :>, File.size(__FILE__)]
946
+ assert_operator page.body.bytesize, :>, File.size(__FILE__)
947
947
  end
948
948
 
949
949
  def test_post_file_upload_nonascii
@@ -962,7 +962,7 @@ but not <a href="/" rel="me nofollow">this</a>!
962
962
  page.body
963
963
  )
964
964
  assert_match("Content-Type: application/zip", page.body)
965
- assert_send [page.body.bytesize, :>, File.size(__FILE__)]
965
+ assert_operator page.body.bytesize, :>, File.size(__FILE__)
966
966
  end
967
967
 
968
968
  def test_post_file_upload
@@ -981,7 +981,7 @@ but not <a href="/" rel="me nofollow">this</a>!
981
981
  page.body
982
982
  )
983
983
  assert_match("Content-Type: application/zip", page.body)
984
- assert_send [page.body.bytesize, :>, File.size(__FILE__)]
984
+ assert_operator page.body.bytesize, :>, File.size(__FILE__)
985
985
  end
986
986
 
987
987
  def test_post_redirect
@@ -1087,25 +1087,21 @@ but not <a href="/" rel="me nofollow">this</a>!
1087
1087
 
1088
1088
  assert_match(/Hello World/, @mech.current_page.body)
1089
1089
  refute_empty @mech.cookies
1090
- refute_empty Thread.current[@mech.agent.http.request_key]
1091
1090
 
1092
1091
  @mech.shutdown
1093
1092
 
1094
- assert_nil Thread.current[@mech.agent.http.request_key]
1095
1093
  assert_empty @mech.history
1096
1094
  assert_empty @mech.cookies
1097
1095
  end
1098
1096
 
1099
1097
  def test_start
1100
- body, id = nil
1098
+ body = nil
1101
1099
 
1102
1100
  Mechanize.start do |m|
1103
1101
  body = m.get("http://localhost/").body
1104
- id = m.agent.http.request_key
1105
1102
  end
1106
1103
 
1107
1104
  assert_match(/Hello World/, body)
1108
- assert_nil Thread.current[id]
1109
1105
  end
1110
1106
 
1111
1107
  def test_submit_bad_form_method
@@ -1363,4 +1359,3 @@ but not <a href="/" rel="me nofollow">this</a>!
1363
1359
  end
1364
1360
  end
1365
1361
  end
1366
-
@@ -18,14 +18,21 @@ module Enumerable
18
18
  end
19
19
 
20
20
  class TestMechanizeCookie < Mechanize::TestCase
21
- def silently
22
- warn_level = $VERBOSE
23
- $VERBOSE = false
24
- res = yield
25
- $VERBOSE = warn_level
26
- res
21
+ def assert_cookie_parse url, cookie_text, &block
22
+ cookie = nil
23
+
24
+ block ||= proc { |p_cookie| cookie = p_cookie }
25
+
26
+ exp_re = /The call of Mechanize::Cookie.parse/
27
+ assert_output "", exp_re do
28
+ Mechanize::Cookie.parse(url, cookie_text, &block)
29
+ end
30
+
31
+ cookie
27
32
  end
28
33
 
34
+ alias silently capture_io
35
+
29
36
  def test_parse_dates
30
37
  url = URI.parse('http://localhost/')
31
38
 
@@ -64,7 +71,7 @@ class TestMechanizeCookie < Mechanize::TestCase
64
71
 
65
72
  uri = URI.parse 'http://example'
66
73
 
67
- Mechanize::Cookie.parse uri, cookie_str do |cookie|
74
+ assert_cookie_parse uri, cookie_str do |cookie|
68
75
  assert_equal 'a', cookie.name
69
76
  assert_equal 'b', cookie.value
70
77
  end
@@ -75,7 +82,7 @@ class TestMechanizeCookie < Mechanize::TestCase
75
82
 
76
83
  uri = URI.parse 'http://example'
77
84
 
78
- Mechanize::Cookie.parse uri, cookie_str do |cookie|
85
+ assert_cookie_parse uri, cookie_str do |cookie|
79
86
  assert_equal 'foo', cookie.name
80
87
  assert_equal 'bar', cookie.value
81
88
  assert_equal '/', cookie.path
@@ -89,7 +96,7 @@ class TestMechanizeCookie < Mechanize::TestCase
89
96
 
90
97
  uri = URI.parse 'http://example'
91
98
 
92
- Mechanize::Cookie.parse uri, cookie_str do |cookie|
99
+ assert_cookie_parse uri, cookie_str do |cookie|
93
100
  assert_equal 'quoted', cookie.name
94
101
  assert_equal 'value', cookie.value
95
102
  end
@@ -98,35 +105,37 @@ class TestMechanizeCookie < Mechanize::TestCase
98
105
  def test_parse_weird_cookie
99
106
  cookie = 'n/a, ASPSESSIONIDCSRRQDQR=FBLDGHPBNDJCPCGNCPAENELB; path=/'
100
107
  url = URI.parse('http://www.searchinnovation.com/')
101
- Mechanize::Cookie.parse(url, cookie) { |c|
108
+ assert_cookie_parse url, cookie do |c|
102
109
  assert_equal('ASPSESSIONIDCSRRQDQR', c.name)
103
110
  assert_equal('FBLDGHPBNDJCPCGNCPAENELB', c.value)
104
- }
111
+ end
105
112
  end
106
113
 
107
114
  def test_double_semicolon
108
115
  double_semi = 'WSIDC=WEST;; domain=.williams-sonoma.com; path=/'
109
116
  url = URI.parse('http://williams-sonoma.com/')
110
- Mechanize::Cookie.parse(url, double_semi) { |cookie|
117
+ assert_cookie_parse url, double_semi do |cookie|
111
118
  assert_equal('WSIDC', cookie.name)
112
119
  assert_equal('WEST', cookie.value)
113
- }
120
+ end
114
121
  end
115
122
 
116
123
  def test_parse_bad_version
117
124
  bad_cookie = 'PRETANET=TGIAqbFXtt; Name=/PRETANET; Path=/; Version=1.2; Content-type=text/html; Domain=192.168.6.196; expires=Friday, 13-November-2026 23:01:46 GMT;'
118
125
  url = URI.parse('http://localhost/')
119
- Mechanize::Cookie.parse(url, bad_cookie) { |cookie|
126
+
127
+ assert_cookie_parse url, bad_cookie do |cookie|
120
128
  assert_nil(cookie.version)
121
- }
129
+ end
122
130
  end
123
131
 
124
132
  def test_parse_bad_max_age
125
133
  bad_cookie = 'PRETANET=TGIAqbFXtt; Name=/PRETANET; Path=/; Max-Age=1.2; Content-type=text/html; Domain=192.168.6.196; expires=Friday, 13-November-2026 23:01:46 GMT;'
126
134
  url = URI.parse('http://localhost/')
127
- Mechanize::Cookie.parse(url, bad_cookie) { |cookie|
135
+
136
+ assert_cookie_parse url, bad_cookie do |cookie|
128
137
  assert_nil(cookie.max_age)
129
- }
138
+ end
130
139
  end
131
140
 
132
141
  def test_parse_date_fail
@@ -151,7 +160,7 @@ class TestMechanizeCookie < Mechanize::TestCase
151
160
 
152
161
  cookie_str = 'a=b; domain=.example.com'
153
162
 
154
- cookie = Mechanize::Cookie.parse(url, cookie_str).first
163
+ cookie = assert_cookie_parse url, cookie_str
155
164
 
156
165
  assert_equal 'example.com', cookie.domain
157
166
  assert cookie.for_domain?
@@ -162,7 +171,7 @@ class TestMechanizeCookie < Mechanize::TestCase
162
171
 
163
172
  cookie_str = 'a=b; domain=example.com'
164
173
 
165
- cookie = Mechanize::Cookie.parse(url, cookie_str).first
174
+ cookie = assert_cookie_parse url, cookie_str
166
175
 
167
176
  assert_equal 'example.com', cookie.domain
168
177
  assert cookie.for_domain?
@@ -173,7 +182,7 @@ class TestMechanizeCookie < Mechanize::TestCase
173
182
 
174
183
  cookie_str = 'a=b;'
175
184
 
176
- cookie = Mechanize::Cookie.parse(url, cookie_str).first
185
+ cookie = assert_cookie_parse url, cookie_str
177
186
 
178
187
  assert_equal 'example.com', cookie.domain
179
188
  assert !cookie.for_domain?
@@ -184,17 +193,23 @@ class TestMechanizeCookie < Mechanize::TestCase
184
193
 
185
194
  date = 'Mon, 19 Feb 2012 19:26:04 GMT'
186
195
 
187
- cookie = Mechanize::Cookie.parse(url, "name=Akinori; expires=#{date}").first
196
+ cookie_text = "name=Akinori; expires=#{date}"
197
+ cookie = assert_cookie_parse url, cookie_text
188
198
  assert_equal Time.at(1329679564), cookie.expires
189
199
 
190
- cookie = Mechanize::Cookie.parse(url, 'name=Akinori; max-age=3600').first
200
+ cookie_text = 'name=Akinori; max-age=3600'
201
+ cookie = assert_cookie_parse url, cookie_text
191
202
  assert_in_delta Time.now + 3600, cookie.expires, 1
192
203
 
193
204
  # Max-Age has precedence over Expires
194
- cookie = Mechanize::Cookie.parse(url, "name=Akinori; max-age=3600; expires=#{date}").first
205
+ cookie_text = "name=Akinori; max-age=3600; expires=#{date}"
206
+ cookie = assert_cookie_parse url, cookie_text
207
+
195
208
  assert_in_delta Time.now + 3600, cookie.expires, 1
196
209
 
197
- cookie = Mechanize::Cookie.parse(url, "name=Akinori; expires=#{date}; max-age=3600").first
210
+ cookie_text = "name=Akinori; expires=#{date}; max-age=3600"
211
+ cookie = assert_cookie_parse url, cookie_text
212
+
198
213
  assert_in_delta Time.now + 3600, cookie.expires, 1
199
214
  end
200
215
 
@@ -208,7 +223,7 @@ class TestMechanizeCookie < Mechanize::TestCase
208
223
  'name=Akinori; expires=',
209
224
  'name=Akinori; max-age=',
210
225
  ].each { |str|
211
- cookie = Mechanize::Cookie.parse(url, str).first
226
+ cookie = assert_cookie_parse url, str
212
227
  assert cookie.session, str
213
228
  }
214
229
 
@@ -216,7 +231,7 @@ class TestMechanizeCookie < Mechanize::TestCase
216
231
  'name=Akinori; expires=Mon, 19 Feb 2012 19:26:04 GMT',
217
232
  'name=Akinori; max-age=3600',
218
233
  ].each { |str|
219
- cookie = Mechanize::Cookie.parse(url, str).first
234
+ cookie = assert_cookie_parse url, str
220
235
  assert !cookie.session, str
221
236
  }
222
237
  end
@@ -237,7 +252,8 @@ class TestMechanizeCookie < Mechanize::TestCase
237
252
  "no_domain2=no_domain; Expires=Sun, 06 Nov 2011 00:29:53 GMT; no_expires=nope; Domain, " \
238
253
  "no_domain3=no_domain; Expires=Sun, 06 Nov 2011 00:29:53 GMT; no_expires=nope; Domain="
239
254
 
240
- cookies = Mechanize::Cookie.parse url, cookie_str
255
+ cookies = nil
256
+ silently { cookies = Mechanize::Cookie.parse url, cookie_str }
241
257
  assert_equal 13, cookies.length
242
258
 
243
259
  name = cookies.find { |c| c.name == 'name' }
@@ -293,8 +309,8 @@ class TestMechanizeCookie < Mechanize::TestCase
293
309
  cookie_text << "#{cookie_params[key]}; "
294
310
  end
295
311
  end
296
- cookie = nil
297
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie }
312
+
313
+ cookie = assert_cookie_parse url, cookie_text
298
314
 
299
315
  assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)
300
316
  assert_equal('/', cookie.path)
@@ -328,8 +344,7 @@ class TestMechanizeCookie < Mechanize::TestCase
328
344
  cookie_text << "#{cookie_params[key]}; "
329
345
  end
330
346
  end
331
- cookie = nil
332
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie }
347
+ cookie = assert_cookie_parse url, cookie_text
333
348
 
334
349
  assert_equal('12345%7D=', cookie.to_s)
335
350
  assert_equal('', cookie.value)
@@ -366,8 +381,8 @@ class TestMechanizeCookie < Mechanize::TestCase
366
381
  cookie_text << "#{cookie_params[key]}; "
367
382
  end
368
383
  end
369
- cookie = nil
370
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie }
384
+
385
+ cookie = assert_cookie_parse url, cookie_text
371
386
 
372
387
  assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)
373
388
  assert_equal('/', cookie.path)
@@ -403,8 +418,8 @@ class TestMechanizeCookie < Mechanize::TestCase
403
418
  cookie_text << "#{cookie_params[key]}; "
404
419
  end
405
420
  end
406
- cookie = nil
407
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie }
421
+
422
+ cookie = assert_cookie_parse url, cookie_text
408
423
 
409
424
  assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)
410
425
  assert_equal('/', cookie.path)
@@ -439,8 +454,8 @@ class TestMechanizeCookie < Mechanize::TestCase
439
454
  cookie_text << "#{cookie_params[key]};"
440
455
  end
441
456
  end
442
- cookie = nil
443
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie }
457
+
458
+ cookie = assert_cookie_parse url, cookie_text
444
459
 
445
460
  assert_equal('12345%7D=ASDFWEE345%3DASda', cookie.to_s)
446
461
  assert_equal('/', cookie.path)
@@ -458,7 +473,7 @@ class TestMechanizeCookie < Mechanize::TestCase
458
473
  cookie = Mechanize::Cookie.new('key', 'value')
459
474
  assert_equal 'key', cookie.name
460
475
  assert_equal 'value', cookie.value
461
- assert_equal nil, cookie.expires
476
+ assert_nil cookie.expires
462
477
 
463
478
  # Minimum unit for the expires attribute is second
464
479
  expires = Time.at((Time.now + 3600).to_i)
@@ -478,7 +493,7 @@ class TestMechanizeCookie < Mechanize::TestCase
478
493
  url = URI.parse('http://host.dom.example.com:8080/')
479
494
 
480
495
  cookie_str = 'a=b; domain=Example.Com'
481
- cookie = Mechanize::Cookie.parse(url, cookie_str).first
496
+ cookie = assert_cookie_parse url, cookie_str
482
497
  assert 'example.com', cookie.domain
483
498
 
484
499
  cookie.domain = DomainName(url.host)
@@ -512,8 +527,8 @@ class TestMechanizeCookie < Mechanize::TestCase
512
527
  cookie_text << "#{cookie_params[key]}; "
513
528
  end
514
529
  end
515
- cookie = nil
516
- Mechanize::Cookie.parse(url, cookie_text) { |p_cookie| cookie = p_cookie; }
530
+
531
+ cookie = assert_cookie_parse url, cookie_text
517
532
 
518
533
  assert_equal(true, cookie.httponly)
519
534