vcr 1.7.2 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,12 @@
1
1
  ## In git
2
2
 
3
- [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.7.2...master)
3
+ [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.8.0...master)
4
+
5
+ ## 1.8.0 (March 31, 2011)
6
+
7
+ [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.7.2...v1.8.0)
8
+
9
+ * Updated Faraday middleware to work with newly released Faraday 0.6.0.
4
10
 
5
11
  ## 1.7.2 (March 26, 2011)
6
12
 
@@ -6,8 +6,8 @@ module VCR
6
6
  include Common
7
7
  extend self
8
8
 
9
- MINIMUM_VERSION = '0.5.3'
10
- MAXIMUM_VERSION = '0.5'
9
+ MINIMUM_VERSION = '0.6.0'
10
+ MAXIMUM_VERSION = '0.6'
11
11
 
12
12
  attr_writer :http_connections_allowed
13
13
 
@@ -16,13 +16,13 @@ module VCR
16
16
  if VCR::HttpStubbingAdapters::Faraday.uri_should_be_ignored?(request.uri)
17
17
  @app.call(env)
18
18
  elsif response = VCR::HttpStubbingAdapters::Faraday.stubbed_response_for(request_matcher)
19
- env.update(
20
- :status => response.status.code,
21
- :response_headers => normalized_headers(response.headers),
22
- :body => response.body
23
- )
19
+ headers = env[:response_headers] ||= ::Faraday::Utils::Headers.new
20
+ headers.update response.headers if response.headers
21
+ env.update :status => response.status.code, :body => response.body
24
22
 
25
- env[:response].finish(env)
23
+ faraday_response = ::Faraday::Response.new
24
+ faraday_response.finish(env) unless env[:parallel_manager]
25
+ env[:response] = faraday_response
26
26
  elsif VCR::HttpStubbingAdapters::Faraday.http_connections_allowed?
27
27
  response = @app.call(env)
28
28
 
@@ -63,16 +63,6 @@ module VCR
63
63
  '1.1'
64
64
  )
65
65
  end
66
-
67
- def normalized_headers(headers)
68
- hash = {}
69
-
70
- headers.each do |key, values|
71
- hash[key] = values.join(', ')
72
- end if headers
73
-
74
- hash
75
- end
76
66
  end
77
67
  end
78
68
  end
@@ -3,7 +3,7 @@ module VCR
3
3
 
4
4
  def version
5
5
  @version ||= begin
6
- string = '1.7.2'
6
+ string = '1.8.0'
7
7
 
8
8
  def string.parts
9
9
  split('.').map { |p| p.to_i }
@@ -127,8 +127,8 @@ end
127
127
  end
128
128
 
129
129
  def get_header(header_key, response)
130
- header = response.headers[header_key.downcase]
131
- header.split(', ')
130
+ value = response.headers[header_key]
131
+ value.split(', ') if value
132
132
  end
133
133
 
134
134
  def make_http_request(method, url, body = nil, headers = {})
@@ -25,7 +25,6 @@ shared_examples_for "an http library" do |library, supported_request_match_attri
25
25
  define_method :should_be_pending do
26
26
  if header_count == 2
27
27
  [
28
- 'Faraday (patron)',
29
28
  'HTTP Client',
30
29
  'EM HTTP Request',
31
30
  'Curb'
@@ -7,9 +7,9 @@ describe VCR::HttpStubbingAdapters::Faraday, :without_monkey_patches => :all do
7
7
  :status_message_not_exposed, :does_not_support_rotating_responses
8
8
 
9
9
  it_performs('version checking',
10
- :valid => %w[ 0.5.3 0.5.10 ],
11
- :too_low => %w[ 0.5.2 0.4.99 ],
12
- :too_high => %w[ 0.6.0 1.0.0 ]
10
+ :valid => %w[ 0.6.0 0.6.10 ],
11
+ :too_low => %w[ 0.5.9 0.4.99 ],
12
+ :too_high => %w[ 0.7.0 1.0.0 ]
13
13
  ) do
14
14
  before(:each) { @orig_version = Faraday::VERSION }
15
15
  after(:each) { Faraday::VERSION = @orig_version }
@@ -29,7 +29,7 @@ Gem::Specification.new do |s|
29
29
  'fakeweb' => '~> 1.3.0',
30
30
  'webmock' => '~> 1.6.0',
31
31
 
32
- 'faraday' => '~> 0.5.3',
32
+ 'faraday' => '~> 0.6.0',
33
33
  'httpclient' => '~> 2.1.5.2',
34
34
 
35
35
  'timecop' => '~> 0.3.5',
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 55
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 7
9
- - 2
10
- version: 1.7.2
8
+ - 8
9
+ - 0
10
+ version: 1.8.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Myron Marston
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-26 00:00:00 -07:00
18
+ date: 2011-03-31 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -27,12 +27,12 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- hash: 13
30
+ hash: 7
31
31
  segments:
32
32
  - 0
33
- - 5
34
- - 3
35
- version: 0.5.3
33
+ - 6
34
+ - 0
35
+ version: 0.6.0
36
36
  requirement: *id001
37
37
  - !ruby/object:Gem::Dependency
38
38
  prerelease: false