myronmarston/vcr — Issue #138: VCR.turned_off not turning off
Author: jtushman
Created: 2012-02-22 16:34:51+00:00
State: open

I upgraded from beta to the latest RC, and my turned_off block seemed to regress.

In a cucumber hook, that I use do some cleanup of s3, I get the following:

/Users/jtushman/.rvm/gems/ruby-1.9.2-p290/gems/webmock-1.7.8/lib/webmock/http_lib_adapters/net_http.rb:99:in `request_with_webmock': Real HTTP connections are disabled. Unregistered request: GET MY_SE_PATH with headers {'Accept'=>'*/*', 'Authorization'=>'AWS MY KEY', 'Content-Length'=>'0', 'Content-Type'=>'binary/octet-stream', 'Date'=>'Wed, 22 Feb 2012 16:24:18 GMT', 'Host'=>'s3.amazonaws.com', 'User-Agent'=>'Ruby'} (WebMock::NetConnectNotAllowedError)

You can stub this request with the following snippet:

stub_request(:get, "http://s3.my_s3_url").
with(:headers => {'Accept'=>'*/*', 'Authorization'=>'AWS MY_KEY', 'Content-Length'=>'0', 'Content-Type'=>'binary/octet- stream', 'Date'=>'Wed, 22 Feb 2012 16:24:18 GMT', 'Host'=>'s3.amazonaws.com', 'User-Agent'=>'Ruby'}).to_return(:status => 200, :body => "", :headers => {})

registered request stubs:

stub_request(:any, "/.*/")

I am using:
gem 'vcr', '2.0.0.rc1 '
gem 'webmock','1.7.8'

Thanks -- let me know if you need more info