rack-client 0.3.1.pre.c → 0.3.1.pre.d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. data/lib/rack/client/adapter/base.rb +0 -1
  2. data/lib/rack/client/adapter/simple.rb +13 -4
  3. data/lib/rack/client/version.rb +1 -1
  4. metadata +80 -108
  5. data/spec/core/headers_spec.rb +0 -47
  6. data/spec/core/headers_spec.rbc +0 -1674
  7. data/spec/core/response_spec.rb +0 -78
  8. data/spec/core/response_spec.rbc +0 -2244
  9. data/spec/handler/em_http_spec.rb +0 -7
  10. data/spec/handler/em_http_spec.rbc +0 -224
  11. data/spec/handler/excon_spec.rb +0 -7
  12. data/spec/handler/excon_spec.rbc +0 -224
  13. data/spec/handler/net_http_spec.rb +0 -11
  14. data/spec/handler/net_http_spec.rbc +0 -307
  15. data/spec/handler/typhoeus_spec.rb +0 -11
  16. data/spec/handler/typhoeus_spec.rbc +0 -307
  17. data/spec/helpers/async_helper.rb +0 -31
  18. data/spec/helpers/async_helper.rbc +0 -843
  19. data/spec/helpers/em_http_helper.rb +0 -24
  20. data/spec/helpers/em_http_helper.rbc +0 -663
  21. data/spec/helpers/excon_helper.rb +0 -13
  22. data/spec/helpers/excon_helper.rbc +0 -461
  23. data/spec/helpers/handler_helper.rb +0 -68
  24. data/spec/helpers/handler_helper.rbc +0 -1769
  25. data/spec/helpers/net_http_helper.rb +0 -26
  26. data/spec/helpers/net_http_helper.rbc +0 -806
  27. data/spec/helpers/sync_helper.rb +0 -9
  28. data/spec/helpers/sync_helper.rbc +0 -311
  29. data/spec/helpers/typhoeus_helper.rb +0 -32
  30. data/spec/helpers/typhoeus_helper.rbc +0 -936
  31. data/spec/middleware/cache_spec.rb +0 -25
  32. data/spec/middleware/cache_spec.rbc +0 -712
  33. data/spec/middleware/cookie_jar_spec.rb +0 -19
  34. data/spec/middleware/cookie_jar_spec.rbc +0 -614
  35. data/spec/middleware/etag_spec.rb +0 -10
  36. data/spec/middleware/etag_spec.rbc +0 -438
  37. data/spec/middleware/follow_redirects_spec.rb +0 -12
  38. data/spec/middleware/follow_redirects_spec.rbc +0 -402
  39. data/spec/middleware/lint_spec.rb +0 -10
  40. data/spec/middleware/lint_spec.rbc +0 -392
  41. data/spec/shared/handler_api.rb +0 -33
  42. data/spec/shared/handler_api.rbc +0 -1340
  43. data/spec/shared/streamed_response_api.rb +0 -14
  44. data/spec/shared/streamed_response_api.rbc +0 -508
  45. data/spec/spec_apps/cache.ru +0 -14
  46. data/spec/spec_apps/cookie.ru +0 -12
  47. data/spec/spec_apps/delete.ru +0 -10
  48. data/spec/spec_apps/get.ru +0 -13
  49. data/spec/spec_apps/head.ru +0 -10
  50. data/spec/spec_apps/hello_world.ru +0 -1
  51. data/spec/spec_apps/redirect.ru +0 -13
  52. data/spec/spec_apps/stream.ru +0 -9
  53. data/spec/spec_config.ru +0 -10
  54. data/spec/spec_helper.rb +0 -22
@@ -1,78 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Rack::Client::Response do
4
- context "#initialize" do
5
- it 'follows the rack tuple convention for parameters' do
6
- response = Rack::Client::Response.new(200, {'X-Foo' => 'Bar'}, ['Hello World!'])
7
-
8
- response.status.should == 200
9
- response.headers['X-Foo'].should == 'Bar'
10
- response.body.should == ['Hello World!']
11
- end
12
-
13
- it 'accepts a callback for streamed responses' do
14
- body = %w[ This is a streamed response ]
15
- check = body.dup
16
-
17
- response = Rack::Client::Response.new(200) {|block| body.each(&block) }
18
-
19
- response.each do |part|
20
- part.should == check.shift
21
- end
22
-
23
- check.should be_empty
24
- end
25
- end
26
-
27
- context "#each" do
28
- it 'will not loose the streamed body chunks' do
29
- body = %w[ This is also a streamed response ]
30
- check = body.dup
31
-
32
- response = Rack::Client::Response.new(200) {|block| body.each(&block) }
33
-
34
- response.each {|chunk| }
35
-
36
- response.instance_variable_get(:@body).should == check
37
- end
38
-
39
- it 'will yield the existing body before the streamed body' do
40
- existing, streamed = %w[ This is mostly ], %w[ a streamed response ]
41
- check = existing + streamed
42
-
43
- response = Rack::Client::Response.new(200, {}, existing) {|block| streamed.each(&block) }
44
-
45
- response.each do |part|
46
- part.should == check.shift
47
- end
48
-
49
- check.should be_empty
50
- end
51
-
52
- it 'is idempotent' do
53
- body = %w[ This should only appear once ]
54
- check = body.dup
55
-
56
- response = Rack::Client::Response.new(200) {|block| body.each(&block) }
57
-
58
- response.each {|chunk| }
59
-
60
- response.instance_variable_get(:@body).should == check
61
-
62
- response.each {|chunk| }
63
-
64
- response.instance_variable_get(:@body).should == check
65
- end
66
- end
67
-
68
- context '#body' do
69
- it 'will include the body stream' do
70
- body = %w[ This is sorta streamed ]
71
- check = body.dup
72
-
73
- response = Rack::Client::Response.new(200) {|block| body.each(&block) }
74
-
75
- response.body.should == check
76
- end
77
- end
78
- end