vcr 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1 (November 11, 2010)
4
+
5
+ [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.3.0...v.1.3.1)
6
+
7
+ * Update WebMock adapter to work with (and require) newly released WebMock 1.6.0.
8
+
3
9
  ## 1.3.0 (November 11, 2010)
4
10
 
5
11
  [Full Changelog](http://github.com/myronmarston/vcr/compare/v1.2.0...v.1.3.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vcr (1.3.0)
4
+ vcr (1.3.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -83,7 +83,7 @@ GEM
83
83
  thor (0.14.4)
84
84
  timecop (0.3.5)
85
85
  typhoeus (0.2.0)
86
- webmock (1.5.0)
86
+ webmock (1.6.0)
87
87
  addressable (>= 2.2.2)
88
88
  crack (>= 0.1.7)
89
89
 
@@ -113,4 +113,4 @@ DEPENDENCIES
113
113
  timecop (~> 0.3.5)
114
114
  typhoeus (~> 0.2.0)
115
115
  vcr!
116
- webmock (>= 1.5.0)
116
+ webmock (~> 1.6.0)
@@ -18,7 +18,7 @@ def webmock
18
18
  WebMock.stub_request(:get, 'http://example.com').to_return(:body => 'Hello')
19
19
  yield
20
20
  ensure
21
- WebMock.reset_webmock
21
+ WebMock.reset!
22
22
  end
23
23
 
24
24
  def perform_benchmark(name)
@@ -11,12 +11,14 @@ module VCR
11
11
  def self.add_vcr_info_to_exception_message(exception_klass)
12
12
  exception_klass.class_eval do
13
13
  def message
14
- super + ". You can use VCR to automatically record this request and replay it later. " +
15
- "For more details, visit the VCR wiki at: http://github.com/myronmarston/vcr/wiki"
14
+ super + ". " + VCR::HttpStubbingAdapters::Common::RECORDING_INSTRUCTIONS
16
15
  end
17
16
  end
18
17
  end
19
18
 
19
+ RECORDING_INSTRUCTIONS = "You can use VCR to automatically record this request and replay it later. " +
20
+ "For more details, visit the VCR wiki at: http://github.com/myronmarston/vcr/wiki"
21
+
20
22
  def check_version!
21
23
  version_too_low, version_too_high = compare_version
22
24
 
@@ -6,8 +6,8 @@ module VCR
6
6
  include VCR::HttpStubbingAdapters::Common
7
7
  extend self
8
8
 
9
- MINIMUM_VERSION = '1.4.0'
10
- MAXIMUM_VERSION = '1.5'
9
+ MINIMUM_VERSION = '1.6.0'
10
+ MAXIMUM_VERSION = '1.6'
11
11
 
12
12
  def http_connections_allowed=(value)
13
13
  ::WebMock::Config.instance.allow_net_connect = value
@@ -37,11 +37,11 @@ module VCR
37
37
  end
38
38
 
39
39
  def create_stubs_checkpoint(checkpoint_name)
40
- checkpoints[checkpoint_name] = ::WebMock::RequestRegistry.instance.request_stubs.dup
40
+ checkpoints[checkpoint_name] = ::WebMock::StubRegistry.instance.request_stubs.dup
41
41
  end
42
42
 
43
43
  def restore_stubs_checkpoint(checkpoint_name)
44
- ::WebMock::RequestRegistry.instance.request_stubs = checkpoints.delete(checkpoint_name)
44
+ ::WebMock::StubRegistry.instance.request_stubs = checkpoints.delete(checkpoint_name)
45
45
  end
46
46
 
47
47
  private
@@ -94,5 +94,8 @@ WebMock.after_request(:real_requests_only => true) do |request, response|
94
94
  VCR.record_http_interaction(http_interaction)
95
95
  end
96
96
 
97
- VCR::HttpStubbingAdapters::Common.add_vcr_info_to_exception_message(WebMock::NetConnectNotAllowedError)
98
-
97
+ WebMock::NetConnectNotAllowedError.class_eval do
98
+ def stubbing_instructions(*args)
99
+ '. ' + VCR::HttpStubbingAdapters::Common::RECORDING_INSTRUCTIONS
100
+ end
101
+ end
@@ -3,7 +3,7 @@ module VCR
3
3
 
4
4
  def version
5
5
  @version ||= begin
6
- string = '1.3.0'
6
+ string = '1.3.1'
7
7
 
8
8
  def string.parts; VCR.version.split('.').map { |p| p.to_i }; end
9
9
  def string.major; parts[0]; end
@@ -8,9 +8,9 @@ describe VCR::HttpStubbingAdapters::WebMock do
8
8
  [:method, :uri, :host, :path, :body, :headers]
9
9
 
10
10
  it_performs('version checking',
11
- :valid => %w[ 1.4.0 1.4.99 1.5.0 1.5.99 ],
11
+ :valid => %w[ 1.6.0 1.6.99 ],
12
12
  :too_low => %w[ 0.9.9 0.9.10 0.1.30 1.0.30 1.2.9 1.3.9 ],
13
- :too_high => %w[ 1.6.0 1.10.0 2.0.0 ]
13
+ :too_high => %w[ 1.7.0 1.10.0 2.0.0 ]
14
14
  ) do
15
15
  def stub_version(version)
16
16
  WebMock.stub(:version).and_return(version)
@@ -28,7 +28,7 @@ RSpec.configure do |config|
28
28
  VCR::Config.stub_with :fakeweb
29
29
 
30
30
  WebMock.allow_net_connect!
31
- WebMock.reset_webmock
31
+ WebMock.reset!
32
32
 
33
33
  FakeWeb.allow_net_connect = true
34
34
  FakeWeb.clean_registry
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
27
27
  'aruba' => '~> 0.2.1',
28
28
 
29
29
  'fakeweb' => '~> 1.3.0',
30
- 'webmock' => '>= 1.5.0',
30
+ 'webmock' => '~> 1.6.0',
31
31
 
32
32
  'httpclient' => '~> 2.1.5.2',
33
33
 
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 0
10
- version: 1.3.0
9
+ - 1
10
+ version: 1.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Myron Marston
@@ -167,14 +167,14 @@ dependencies:
167
167
  version_requirements: &id010 !ruby/object:Gem::Requirement
168
168
  none: false
169
169
  requirements:
170
- - - ">="
170
+ - - ~>
171
171
  - !ruby/object:Gem::Version
172
- hash: 3
172
+ hash: 15
173
173
  segments:
174
174
  - 1
175
- - 5
175
+ - 6
176
176
  - 0
177
- version: 1.5.0
177
+ version: 1.6.0
178
178
  requirement: *id010
179
179
  type: :development
180
180
  name: webmock