Skip to content

Commit

Permalink
No idea
Browse files Browse the repository at this point in the history
  • Loading branch information
pikesley committed Jan 5, 2016
1 parent 7fc82e1 commit 730fea1
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion features/support/vcr.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require 'vcr'
require 'webmock/cucumber'
require 'aruba/cucumber'

VCR.configure do |c|
c.default_cassette_options = { :record => :once }
c.default_cassette_options = { record: :once }
c.cassette_library_dir = 'features/support/vcr'
c.hook_into :webmock
c.allow_http_connections_when_no_cassette = false
Expand All @@ -11,6 +12,7 @@
VCR.cucumber_tags do |t|
t.tag '@vcr', use_scenario_name: true
end

class VcrFriendlyMain
def initialize argv, stdin, stdout, stderr, kernel
@argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
Expand All @@ -23,3 +25,19 @@ def execute!
Multichain::CLI.start @argv
end
end

Before '@vcr' do
Aruba.configure do |config|
config.command_launcher = :in_process
config.main_class = VcrFriendlyMain
end
end

After '@vcr' do
Aruba.configure { |config| config.command_launcher = :spawn }

VCR.eject_cassette
$stdin = STDIN
$stdout = STDOUT
$stderr = STDERR
end

0 comments on commit 730fea1

Please sign in to comment.