class Thor::Task

Public Instance Methods

run_with_vcr(instance, args=[]) click to toggle source
# File lib/vcr_helper.rb, line 16
def run_with_vcr(instance, args=[])
  if ENV['VCR_CASSETTE']
    cassette_name = ENV.delete('VCR_CASSETTE')

    VCR.configure do |c|
      c.cassette_library_dir = Holistics.root.join 'features/vcr_cassettes'
      c.default_cassette_options = {:record => :new_episodes}
      c.hook_into :webmock
    end

    VCR.use_cassette(cassette_name) do
      run_without_vcr(instance, args)
    end
  else
    run_without_vcr(instance, args)
  end


end