Reputation: 5962
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.
Upvotes: 2
Views: 825
Reputation: 15562
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"
Upvotes: 2