Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Matt Parker's Profile

GitHub User: moonmaster9000

Site: http://twitter.com/moonmaster9000

Comments by Matt Parker

Avatar

seperate before/after:

ruby
Before do |scenario|
  if scenario.respond_to? :scenario_outline
    feature = scenario.scenario_outline.feature
  else
    feature = scenario.feature
  end

  cassette_name = "#{feature.name.split("\n").first}/#{scenario.name}"
  VCR.insert_cassette(cassette_name)
end

After do
  VCR.eject_cassette
end