开发者

Where to put VCR config when using both rspec and cucumber

I'm using both rspec and cucumber. Cucumber of integration level tests, but rspec for unit tests.

I'm using vcr for cucumber already, but want to use it for rspec, too. Where's the right place to put the vcr configuration? I开发者_开发知识库'd rather not replicate it in both features/support and rspec/support.


Cucumber doesn't "know" about RSpec, nor vice-versa. If you don't want to duplicate it, define it in its own file, say spec/support/vcr_setup.rb, and then include that in both.

features/support/env.rb:
require File.expand_path("../../../spec/support/vcr_setup", __FILE__)
(think that's right, adjust path as needed)

spec/spec_helper.rb:
require "support/vcr_setup"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜