namelessjon-curb 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ /* curb_postfield.h - Field class for POST method
2
+ * Copyright (c)2006 Ross Bamford.
3
+ * Licensed under the Ruby License. See LICENSE for details.
4
+ *
5
+ * $Id: curb_postfield.h 4 2006-11-17 18:35:31Z roscopeco $
6
+ */
7
+ #ifndef __CURB_POSTFIELD_H
8
+ #define __CURB_POSTFIELD_H
9
+
10
+ #include "curb.h"
11
+
12
+ /*
13
+ * postfield doesn't actually wrap a curl_httppost - instead,
14
+ * it just holds together some ruby objects and has a C-side
15
+ * method to add it to a given form list during the perform.
16
+ */
17
+ typedef struct {
18
+ /* Objects we associate */
19
+ VALUE name;
20
+ VALUE content;
21
+ VALUE content_type;
22
+ VALUE content_proc;
23
+ VALUE local_file;
24
+ VALUE remote_file;
25
+
26
+ /* this will sometimes hold a string, which is the result
27
+ * of the content_proc invocation. We need it to hang around.
28
+ */
29
+ VALUE buffer_str;
30
+ } ruby_curl_postfield;
31
+
32
+ extern VALUE cCurlPostField;
33
+
34
+ void append_to_form(VALUE self,
35
+ struct curl_httppost **first,
36
+ struct curl_httppost **last);
37
+
38
+ void init_curb_postfield();
39
+
40
+ #endif
@@ -0,0 +1,2 @@
1
+ require 'curb'
2
+
@@ -0,0 +1,81 @@
1
+ require 'mkmf'
2
+
3
+ dir_config('curl')
4
+
5
+ if find_executable('curl-config')
6
+ $CFLAGS << " #{`curl-config --cflags`.strip}"
7
+ $LIBS << " #{`curl-config --libs`.strip}"
8
+ elsif !have_library('curl') or !have_header('curl/curl.h')
9
+ fail <<-EOM
10
+ Can't find libcurl or curl/curl.h
11
+
12
+ Try passing --with-curl-dir or --with-curl-lib and --with-curl-include
13
+ options to extconf.
14
+ EOM
15
+ end
16
+
17
+ def define(s)
18
+ $defs.push( format("-D HAVE_%s", s.to_s.upcase) )
19
+ end
20
+
21
+ def have_constant(name)
22
+ checking_for name do
23
+ src = %{
24
+ #include <curl/curl.h>
25
+ int main() {
26
+ int test = (int)#{name.upcase};
27
+ return 0;
28
+ }
29
+ }
30
+ if try_compile(src,"#{$CFLAGS} #{$LIBS}")
31
+ define name
32
+ true
33
+ else
34
+ false
35
+ end
36
+ end
37
+ end
38
+
39
+ have_constant "curlinfo_redirect_time"
40
+ have_constant "curlinfo_response_code"
41
+ have_constant "curlinfo_filetime"
42
+ have_constant "curlinfo_redirect_count"
43
+ have_constant "curlinfo_os_errno"
44
+ have_constant "curlinfo_num_connects"
45
+ have_constant "curlinfo_ftp_entry_path"
46
+ have_constant "curl_version_ssl"
47
+ have_constant "curl_version_libz"
48
+ have_constant "curl_version_ntlm"
49
+ have_constant "curl_version_gssnegotiate"
50
+ have_constant "curl_version_debug"
51
+ have_constant "curl_version_asynchdns"
52
+ have_constant "curl_version_spnego"
53
+ have_constant "curl_version_largefile"
54
+ have_constant "curl_version_idn"
55
+ have_constant "curl_version_sspi"
56
+ have_constant "curl_version_conv"
57
+ have_constant "curlproxy_http"
58
+ have_constant "curlproxy_socks4"
59
+ have_constant "curlproxy_socks5"
60
+ have_constant "curlauth_basic"
61
+ have_constant "curlauth_digest"
62
+ have_constant "curlauth_gssnegotiate"
63
+ have_constant "curlauth_ntlm"
64
+ have_constant "curlauth_anysafe"
65
+ have_constant "curlauth_any"
66
+ have_constant "curle_tftp_notfound"
67
+ have_constant "curle_tftp_perm"
68
+ have_constant "curle_tftp_diskfull"
69
+ have_constant "curle_tftp_illegal"
70
+ have_constant "curle_tftp_unknownid"
71
+ have_constant "curle_tftp_exists"
72
+ have_constant "curle_tftp_nosuchuser"
73
+
74
+ $INSTALLFILES = [["curb.rb", "$(RUBYLIBDIR)", "../ext"], ["curl.rb", "$(RUBYLIBDIR)", "../ext"]]
75
+
76
+ if try_compile('int main() { return 0; }','-Wall')
77
+ $CFLAGS << ' -Wall'
78
+ end
79
+
80
+ create_header('curb_config.h')
81
+ create_makefile('curb_core')
@@ -0,0 +1,109 @@
1
+ # DO NOT REMOVE THIS COMMENT - PART OF TESTMODEL.
2
+ # Copyright (c)2006 Ross Bamford. See LICENSE.
3
+ $CURB_TESTING = true
4
+ require 'uri'
5
+
6
+ $TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), '..'))
7
+ $EXTDIR = File.join($TOPDIR, 'ext')
8
+ $LIBDIR = File.join($TOPDIR, 'lib')
9
+ $:.unshift($LIBDIR)
10
+ $:.unshift($EXTDIR)
11
+
12
+ require 'curb'
13
+ require 'test/unit'
14
+
15
+ $TEST_URL = "file://#{URI.escape(File.expand_path(__FILE__).tr('\\','/').tr(':','|'))}"
16
+
17
+ require 'thread'
18
+ require 'webrick'
19
+
20
+ # keep webrick quiet
21
+ class ::WEBrick::HTTPServer
22
+ def access_log(config, req, res)
23
+ # nop
24
+ end
25
+ end
26
+ class ::WEBrick::BasicLog
27
+ def log(level, data)
28
+ # nop
29
+ end
30
+ end
31
+
32
+ #
33
+ # Simple test server to record number of times a request is sent/recieved of a specific
34
+ # request type, e.g. GET,POST,PUT,DELETE
35
+ #
36
+ class TestServlet < WEBrick::HTTPServlet::AbstractServlet
37
+
38
+ def self.port=(p)
39
+ @port = p
40
+ end
41
+
42
+ def self.port
43
+ (@port or 9129)
44
+ end
45
+
46
+ def self.path
47
+ '/methods'
48
+ end
49
+
50
+ def self.url
51
+ "http://127.0.0.1:#{port}#{path}"
52
+ end
53
+
54
+ def respond_with(method,req,res)
55
+ res.body = method.to_s
56
+ res['Content-Type'] = "text/plain"
57
+ end
58
+
59
+ def do_GET(req,res)
60
+ respond_with(:GET,req,res)
61
+ end
62
+
63
+ def do_POST(req,res)
64
+ respond_with(:POST,req,res)
65
+ end
66
+
67
+ def do_PUT(req,res)
68
+ respond_with(:PUT,req,res)
69
+ end
70
+
71
+ def do_DELETE(req,res)
72
+ respond_with(:DELETE,req,res)
73
+ end
74
+
75
+ end
76
+
77
+ module TestServerMethods
78
+ def locked_file
79
+ File.join(File.dirname(__FILE__),"server_lock-#{@__port}")
80
+ end
81
+
82
+ def server_setup(port=9129,servlet=TestServlet)
83
+ @__port = port
84
+ if @server.nil? and !File.exist?(locked_file)
85
+ File.open(locked_file,'w') {|f| f << 'locked' }
86
+
87
+ # start up a webrick server for testing delete
88
+ @server = WEBrick::HTTPServer.new :Port => port, :DocumentRoot => File.expand_path(File.dirname(__FILE__))
89
+
90
+ @server.mount(servlet.path, servlet)
91
+
92
+ @test_thread = Thread.new { @server.start }
93
+
94
+ exit_code = lambda do
95
+ begin
96
+ #puts "stopping"
97
+ File.unlink locked_file if File.exist?(locked_file)
98
+ @server.shutdown unless @server.nil?
99
+ rescue Object => e
100
+ puts "Error #{__FILE__}:#{__LINE__}\n#{e.message}"
101
+ end
102
+ end
103
+
104
+ trap("INT"){exit_code.call}
105
+ at_exit{exit_code.call}
106
+
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,495 @@
1
+ require File.join(File.dirname(__FILE__), 'helper')
2
+
3
+ class TestCurbCurlEasy < Test::Unit::TestCase
4
+ def test_class_perform_01
5
+ assert_instance_of Curl::Easy, c = Curl::Easy.perform($TEST_URL)
6
+ assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str)
7
+ assert_equal "", c.header_str
8
+ end
9
+
10
+ def test_class_perform_02
11
+ data = ""
12
+ assert_instance_of Curl::Easy, c = Curl::Easy.perform($TEST_URL) { |curl| curl.on_body { |d| data << d; d.length } }
13
+
14
+ assert_nil c.body_str
15
+ assert_equal "", c.header_str
16
+ assert_match(/^# DO NOT REMOVE THIS COMMENT/, data)
17
+ end
18
+
19
+ def test_class_perform_03
20
+ assert_raise(Curl::Err::CouldntReadError) { c = Curl::Easy.perform($TEST_URL + "nonexistent") }
21
+ end
22
+
23
+ def test_new_01
24
+ c = Curl::Easy.new
25
+ assert_nil c.url
26
+ assert_nil c.body_str
27
+ assert_nil c.header_str
28
+ end
29
+
30
+ def test_new_02
31
+ c = Curl::Easy.new($TEST_URL)
32
+ assert_equal $TEST_URL, c.url
33
+ end
34
+
35
+ def test_new_03
36
+ blk = lambda { |i| i.length }
37
+
38
+ c = Curl::Easy.new do |curl|
39
+ curl.on_body(&blk)
40
+ end
41
+
42
+ assert_nil c.url
43
+ assert_equal blk, c.on_body # sets handler nil, returns old handler
44
+ assert_equal nil, c.on_body
45
+ end
46
+
47
+ def test_new_04
48
+ blk = lambda { |i| i.length }
49
+
50
+ c = Curl::Easy.new($TEST_URL) do |curl|
51
+ curl.on_body(&blk)
52
+ end
53
+
54
+ assert_equal $TEST_URL, c.url
55
+ assert_equal blk, c.on_body # sets handler nil, returns old handler
56
+ assert_equal nil, c.on_body
57
+ end
58
+
59
+ def test_escape
60
+ c = Curl::Easy.new
61
+
62
+ assert_equal "one%20two", c.escape('one two')
63
+ assert_equal "one%00two%20three", c.escape("one\000two three")
64
+ end
65
+
66
+ def test_unescape
67
+ c = Curl::Easy.new
68
+
69
+ assert_equal "one two", c.unescape('one%20two')
70
+
71
+ # prior to 7.15.4 embedded nulls cannot be unescaped
72
+ if Curl::VERNUM >= 0x070f04
73
+ assert_equal "one\000two three", c.unescape("one%00two%20three")
74
+ end
75
+ end
76
+
77
+ def test_headers
78
+ c = Curl::Easy.new($TEST_URL)
79
+
80
+ assert_equal({}, c.headers)
81
+ c.headers = "Expect:"
82
+ assert_equal "Expect:", c.headers
83
+ c.headers = ["Expect:", "User-Agent: myapp-0.0.0"]
84
+ assert_equal ["Expect:", "User-Agent: myapp-0.0.0"], c.headers
85
+ end
86
+
87
+ def test_get_01
88
+ c = Curl::Easy.new($TEST_URL)
89
+ assert_equal true, c.http_get
90
+ assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str)
91
+ assert_equal "", c.header_str
92
+ end
93
+
94
+ def test_get_02
95
+ data = ""
96
+ c = Curl::Easy.new($TEST_URL) do |curl|
97
+ curl.on_body { |d| data << d; d.length }
98
+ end
99
+
100
+ assert_equal true, c.http_get
101
+
102
+ assert_nil c.body_str
103
+ assert_equal "", c.header_str
104
+ assert_match(/^# DO NOT REMOVE THIS COMMENT/, data)
105
+ end
106
+
107
+ def test_get_03
108
+ c = Curl::Easy.new($TEST_URL + "nonexistent")
109
+ assert_raise(Curl::Err::CouldntReadError) { c.http_get }
110
+ assert_equal "", c.body_str
111
+ assert_equal "", c.header_str
112
+ end
113
+
114
+ def test_last_effective_url_01
115
+ c = Curl::Easy.new($TEST_URL)
116
+
117
+ assert_equal $TEST_URL, c.url
118
+ assert_nil c.last_effective_url
119
+
120
+ assert c.http_get
121
+
122
+ assert_equal c.url, c.last_effective_url
123
+ c.url = "file://some/new.url"
124
+
125
+ assert_not_equal c.last_effective_url, c.url
126
+ end
127
+
128
+ def test_local_port_01
129
+ c = Curl::Easy.new($TEST_URL)
130
+
131
+ assert_nil c.local_port
132
+ assert_nil c.local_port_range
133
+ assert_nil c.proxy_port
134
+
135
+ c.local_port = 88
136
+
137
+ assert_equal 88, c.local_port
138
+ assert_nil c.local_port_range
139
+ assert_nil c.proxy_port
140
+
141
+ c.local_port = nil
142
+
143
+ assert_nil c.local_port
144
+ assert_nil c.local_port_range
145
+ assert_nil c.proxy_port
146
+ end
147
+
148
+ def test_local_port_02
149
+ c = Curl::Easy.new($TEST_URL)
150
+
151
+ assert_nil c.local_port
152
+ assert_raise(ArgumentError) { c.local_port = 0 }
153
+ assert_raise(ArgumentError) { c.local_port = 65536 }
154
+ assert_raise(ArgumentError) { c.local_port = -1 }
155
+ end
156
+
157
+ def test_local_port_range_01
158
+ c = Curl::Easy.new($TEST_URL)
159
+
160
+ assert_nil c.local_port_range
161
+ assert_nil c.local_port
162
+ assert_nil c.proxy_port
163
+
164
+ c.local_port_range = 88
165
+ assert_equal 88, c.local_port_range
166
+ assert_nil c.local_port
167
+ assert_nil c.proxy_port
168
+
169
+ c.local_port_range = nil
170
+
171
+ assert_nil c.local_port_range
172
+ assert_nil c.local_port
173
+ assert_nil c.proxy_port
174
+ end
175
+
176
+ def test_local_port_range_02
177
+ c = Curl::Easy.new($TEST_URL)
178
+
179
+ assert_nil c.local_port_range
180
+ assert_raise(ArgumentError) { c.local_port_range = 0 }
181
+ assert_raise(ArgumentError) { c.local_port_range = 65536 }
182
+ assert_raise(ArgumentError) { c.local_port_range = -1 }
183
+ end
184
+
185
+ def test_proxy_url_01
186
+ c = Curl::Easy.new($TEST_URL)
187
+
188
+ assert_equal $TEST_URL, c.url
189
+ assert_nil c.proxy_url
190
+
191
+ c.proxy_url = "http://some.proxy"
192
+
193
+ assert_equal $TEST_URL, c.url
194
+ assert_equal "http://some.proxy", c.proxy_url
195
+
196
+ c.proxy_url = nil
197
+ assert_equal $TEST_URL, c.url
198
+ assert_nil c.proxy_url
199
+ end
200
+
201
+ def test_proxy_port_01
202
+ c = Curl::Easy.new($TEST_URL)
203
+
204
+ assert_nil c.local_port
205
+ assert_nil c.local_port_range
206
+ assert_nil c.proxy_port
207
+
208
+ c.proxy_port = 88
209
+
210
+ assert_equal 88, c.proxy_port
211
+ assert_nil c.local_port
212
+ assert_nil c.local_port_range
213
+
214
+ c.proxy_port = nil
215
+ assert_nil c.proxy_port
216
+ assert_nil c.local_port
217
+ assert_nil c.local_port_range
218
+ end
219
+
220
+ def test_proxy_port_02
221
+ c = Curl::Easy.new($TEST_URL)
222
+
223
+ assert_nil c.proxy_port
224
+ assert_raise(ArgumentError) { c.proxy_port = 0 }
225
+ assert_raise(ArgumentError) { c.proxy_port = 65536 }
226
+ assert_raise(ArgumentError) { c.proxy_port = -1 }
227
+ end
228
+
229
+ def test_proxy_type_01
230
+ c = Curl::Easy.new($TEST_URL)
231
+
232
+ assert_nil c.proxy_type
233
+
234
+ c.proxy_type = 3
235
+ assert_equal 3, c.proxy_type
236
+
237
+ c.proxy_type = nil
238
+ assert_nil c.proxy_type
239
+ end
240
+
241
+ def test_http_auth_types_01
242
+ c = Curl::Easy.new($TEST_URL)
243
+
244
+ assert_nil c.http_auth_types
245
+
246
+ c.http_auth_types = 3
247
+ assert_equal 3, c.http_auth_types
248
+
249
+ c.http_auth_types = nil
250
+ assert_nil c.http_auth_types
251
+ end
252
+
253
+ def test_proxy_auth_types_01
254
+ c = Curl::Easy.new($TEST_URL)
255
+
256
+ assert_nil c.proxy_auth_types
257
+
258
+ c.proxy_auth_types = 3
259
+ assert_equal 3, c.proxy_auth_types
260
+
261
+ c.proxy_auth_types = nil
262
+ assert_nil c.proxy_auth_types
263
+ end
264
+
265
+ def test_max_redirects_01
266
+ c = Curl::Easy.new($TEST_URL)
267
+
268
+ assert_nil c.max_redirects
269
+
270
+ c.max_redirects = 3
271
+ assert_equal 3, c.max_redirects
272
+
273
+ c.max_redirects = nil
274
+ assert_nil c.max_redirects
275
+ end
276
+
277
+ def test_timeout_01
278
+ c = Curl::Easy.new($TEST_URL)
279
+
280
+ assert_nil c.timeout
281
+
282
+ c.timeout = 3
283
+ assert_equal 3, c.timeout
284
+
285
+ c.timeout = nil
286
+ assert_nil c.timeout
287
+ end
288
+
289
+ def test_connect_timeout_01
290
+ c = Curl::Easy.new($TEST_URL)
291
+
292
+ assert_nil c.connect_timeout
293
+
294
+ c.connect_timeout = 3
295
+ assert_equal 3, c.connect_timeout
296
+
297
+ c.connect_timeout = nil
298
+ assert_nil c.connect_timeout
299
+ end
300
+
301
+ def test_ftp_response_timeout_01
302
+ c = Curl::Easy.new($TEST_URL)
303
+
304
+ assert_nil c.ftp_response_timeout
305
+
306
+ c.ftp_response_timeout = 3
307
+ assert_equal 3, c.ftp_response_timeout
308
+
309
+ c.ftp_response_timeout = nil
310
+ assert_nil c.ftp_response_timeout
311
+ end
312
+
313
+ def test_dns_cache_timeout_01
314
+ c = Curl::Easy.new($TEST_URL)
315
+
316
+ assert_equal 60, c.dns_cache_timeout
317
+
318
+ c.dns_cache_timeout = nil
319
+ assert_nil c.dns_cache_timeout
320
+
321
+ c.dns_cache_timeout = 30
322
+ assert_equal 30, c.dns_cache_timeout
323
+ end
324
+
325
+ def test_on_body
326
+ blk = lambda { |i| i.length }
327
+
328
+ c = Curl::Easy.new
329
+ c.on_body(&blk)
330
+
331
+ assert_equal blk, c.on_body # sets handler nil, returns old handler
332
+ assert_equal nil, c.on_body
333
+ end
334
+
335
+ def test_on_header
336
+ blk = lambda { |i| i.length }
337
+
338
+ c = Curl::Easy.new
339
+ c.on_header(&blk)
340
+
341
+ assert_equal blk, c.on_header # sets handler nil, returns old handler
342
+ assert_equal nil, c.on_header
343
+ end
344
+
345
+ def test_on_progress
346
+ blk = lambda { |*args| true }
347
+
348
+ c = Curl::Easy.new
349
+ c.on_progress(&blk)
350
+
351
+ assert_equal blk, c.on_progress # sets handler nil, returns old handler
352
+ assert_equal nil, c.on_progress
353
+ end
354
+
355
+ def test_on_debug
356
+ blk = lambda { |*args| true }
357
+
358
+ c = Curl::Easy.new
359
+ c.on_debug(&blk)
360
+
361
+ assert_equal blk, c.on_debug # sets handler nil, returns old handler
362
+ assert_equal nil, c.on_debug
363
+ end
364
+
365
+ def test_proxy_tunnel
366
+ c = Curl::Easy.new
367
+ assert !c.proxy_tunnel?
368
+ assert c.proxy_tunnel = true
369
+ assert c.proxy_tunnel?
370
+ end
371
+
372
+ def test_fetch_file_time
373
+ c = Curl::Easy.new
374
+ assert !c.fetch_file_time?
375
+ assert c.fetch_file_time = true
376
+ assert c.fetch_file_time?
377
+ end
378
+
379
+ def test_ssl_verify_peer
380
+ c = Curl::Easy.new
381
+ assert c.ssl_verify_peer?
382
+ assert !c.ssl_verify_peer = false
383
+ assert !c.ssl_verify_peer?
384
+ end
385
+
386
+ def test_ssl_verify_host
387
+ c = Curl::Easy.new
388
+ assert c.ssl_verify_host?
389
+ assert !c.ssl_verify_host = false
390
+ assert !c.ssl_verify_host?
391
+ end
392
+
393
+ def test_header_in_body
394
+ c = Curl::Easy.new
395
+ assert !c.header_in_body?
396
+ assert c.header_in_body = true
397
+ assert c.header_in_body?
398
+ end
399
+
400
+ def test_use_netrc
401
+ c = Curl::Easy.new
402
+ assert !c.use_netrc?
403
+ assert c.use_netrc = true
404
+ assert c.use_netrc?
405
+ end
406
+
407
+ def test_follow_location
408
+ c = Curl::Easy.new
409
+ assert !c.follow_location?
410
+ assert c.follow_location = true
411
+ assert c.follow_location?
412
+ end
413
+
414
+ def test_unrestricted_auth
415
+ c = Curl::Easy.new
416
+ assert !c.unrestricted_auth?
417
+ assert c.unrestricted_auth = true
418
+ assert c.unrestricted_auth?
419
+ end
420
+
421
+ def test_multipart_form_post
422
+ c = Curl::Easy.new
423
+ assert !c.multipart_form_post?
424
+ assert c.multipart_form_post = true
425
+ assert c.multipart_form_post?
426
+ end
427
+
428
+ def test_enable_cookies
429
+ c = Curl::Easy.new
430
+ assert !c.enable_cookies?
431
+ assert c.enable_cookies = true
432
+ assert c.enable_cookies?
433
+ end
434
+
435
+ def test_cookiejar
436
+ c = Curl::Easy.new
437
+ assert_nil c.cookiejar
438
+ assert_equal "some.file", c.cookiejar = "some.file"
439
+ assert_equal "some.file", c.cookiejar
440
+ end
441
+
442
+ def test_on_success
443
+ curl = Curl::Easy.new($TEST_URL)
444
+ on_success_called = false
445
+ curl.on_success {|c|
446
+ on_success_called = true
447
+ assert_not_nil c.body_str
448
+ assert_equal "", c.header_str
449
+ assert_match(/^# DO NOT REMOVE THIS COMMENT/, c.body_str)
450
+ }
451
+ curl.perform
452
+ assert on_success_called, "Success handler not called"
453
+ end
454
+
455
+ def test_on_success_with_on_failure
456
+ curl = Curl::Easy.new("#{$TEST_URL.gsub(/file:\/\//,'')}/not_here")
457
+ on_failure_called = false
458
+ curl.on_success {|c| } # make sure we get the failure call even though this handler is defined
459
+ curl.on_failure {|c| on_failure_called = true }
460
+ curl.perform
461
+ assert on_failure_called, "Failure handler not called"
462
+ end
463
+
464
+ def test_get_remote
465
+ curl = Curl::Easy.new(TestServlet.url)
466
+ curl.http_get
467
+ assert_equal 'GET', curl.body_str
468
+ end
469
+
470
+ def test_post_remote
471
+ curl = Curl::Easy.new(TestServlet.url)
472
+ curl.http_post
473
+ assert_equal 'POST', curl.body_str
474
+ end
475
+
476
+ def test_delete_remote
477
+ curl = Curl::Easy.new(TestServlet.url)
478
+ curl.http_delete
479
+ assert_equal 'DELETE', curl.body_str
480
+ end
481
+
482
+ # TODO: Curl::Err::CurlError: Not yet implemented
483
+ # def test_put_remote
484
+ # curl = Curl::Easy.new(TestServlet.url)
485
+ # curl.http_put
486
+ # assert_equal 'PUT', curl.body_str
487
+ # end
488
+
489
+ include TestServerMethods
490
+
491
+ def setup
492
+ server_setup
493
+ end
494
+
495
+ end