Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix VCR::Config.http_stubbing_libraries so that it always returns an …

…array.

Previously, it would return nil when it had not been configured; this lead to a confusing error but will now raise an explicit "The http stubbing library is not configured" error.
  • Loading branch information...
commit 26fae52b65abfc5a8a8634e64b1566c198e4377c 1 parent 28173aa
@myronmarston authored
Showing with 15 additions and 1 deletion.
  1. +4 −0 CHANGELOG.md
  2. +4 −1 lib/vcr/config.rb
  3. +7 −0 spec/config_spec.rb
View
4 CHANGELOG.md
@@ -7,6 +7,8 @@
* In specs, hit a local sinatra server rather than example.com. This makes
the specs faster and removes an external dependency. The specs can pass
without being online!
+* Raise an explicit error when the http stubbing library is not configured
+ (rather than letting the user get a confusing error later).
## 1.3.2 (November 16, 2010)
@@ -37,6 +39,8 @@
* Add support for [Typhoeus](https://github.com/pauldix/typhoeus). Thanks to
[David Balatero](https://github.com/dbalatero) for making the necessary changes in Typhoeus
to support VCR.
+* Remove FakeWeb/WebMock inference logic. You _must_ configure the http stubbing library
+ explicitly now.
## 1.2.0 (October 13, 2010)
View
5 lib/vcr/config.rb
@@ -16,11 +16,14 @@ def default_cassette_options
@default_cassette_options
end
- attr_reader :http_stubbing_libraries
def stub_with(*http_stubbing_libraries)
@http_stubbing_libraries = http_stubbing_libraries
end
+ def http_stubbing_libraries
+ @http_stubbing_libraries ||= []
+ end
+
def ignore_localhost=(value)
VCR.http_stubbing_adapter && VCR.http_stubbing_adapter.ignore_localhost = value
@ignore_localhost = value
View
7 spec/config_spec.rb
@@ -35,6 +35,13 @@
end
end
+ describe '.http_stubbing_libraries' do
+ it 'returns an empty array even when the variable is nil' do
+ VCR::Config.send(:remove_instance_variable, :@http_stubbing_libraries)
+ VCR::Config.http_stubbing_libraries.should == []
+ end
+ end
+
describe '#ignore_localhost' do
it 'sets VCR.http_stubbing_adapter.ignore_localhost?' do
[true, false].each do |val|
Please sign in to comment.
Something went wrong with that request. Please try again.