Using vcr selectively within a project

86 views
Skip to first unread message

Karl

unread,
Nov 9, 2010, 3:40:46 PM11/9/10
to VCR Rubygem
Many of my existing cucumber features already make http requests and
although i would like to eventually refactor them, for now they work.
The problem is that when i try to use vcr on just one test within my
suite, vcr breaks the other tests with: "Real HTTP connections are
disabled".

Any way to use vcr selectively?

thx.

-karl

Myron Marston

unread,
Nov 9, 2010, 4:27:47 PM11/9/10
to VCR Rubygem
Hey Karl,

Excellent question. There are ways of doing this, but it's not well
documented or supported yet. There's a discussion on github[1] about
an API that would explicitly allow this. Can you stop by and give
your feedback about how this should work?

In the meantime, you can try this:

VCR.http_stubbing_adapter.http_connections_allowed = true

Put this after your VCR.config block, and it should do the trick.

Note that this is not a documented, supported public API of VCR, so it
is subject to change (especially later on when we do add a document
public API for this). Use with care.

Myron

[1] https://github.com/myronmarston/vcr/issues/21

Karl Baum

unread,
Nov 9, 2010, 4:57:10 PM11/9/10
to vcr-...@googlegroups.com
That seems to work. Commented on the github issue too. Thanks!
Reply all
Reply to author
Forward
0 new messages