Sha256: ae3a126e54e2187c553b63bf7793f4ce2265dbf0ef51da90b66d86c869ab933f

Contents?: true

Size: 1.24 KB

Versions: 14

Compression:

Stored size: 1.24 KB

Contents

# This file gets symlinked into the tmp/aruba directory before
# each scenario so that it is available to be required in them.
$LOAD_PATH.unshift '../../spec' unless $LOAD_PATH.include?('../../spec')
$LOAD_PATH.unshift '../../lib'  unless $LOAD_PATH.include?('../../lib')

RUNNING_UNDER_ARUBA = File.dirname(__FILE__) == '.' || File.dirname(__FILE__) =~ /aruba/

if RUNNING_UNDER_ARUBA
  require 'support/fixnum_extension'
  require 'vcr/util/internet_connection'

  # pretend we're always on the internet (so that we don't have an
  # internet connection dependency for our cukes)
  VCR::InternetConnection.class_eval do
    def available?; true; end
  end
end

if ENV['DAYS_PASSED']
  require 'timecop'
  Timecop.travel(Time.now + ENV['DAYS_PASSED'].to_i.days)
end

def include_http_adapter_for(lib)
  require 'support/http_library_adapters'
  require lib
  include HTTP_LIBRARY_ADAPTERS[lib]
end

def response_body_for(*args)
  get_body_string(make_http_request(*args))
end

def start_sinatra_app(options, &block)
  raise ArgumentError.new("You must pass a port") unless options[:port]

  require 'sinatra'
  require 'support/vcr_localhost_server'
  klass = Class.new(Sinatra::Base)
  klass.class_eval(&block)

  VCR::LocalhostServer.new(klass.new, options[:port])
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
vcr-1.11.3 features/support/vcr_cucumber_helpers.rb
vcr-1.11.2 features/support/vcr_cucumber_helpers.rb
vcr-1.11.1 features/support/vcr_cucumber_helpers.rb
vcr-1.10.3 features/support/vcr_cucumber_helpers.rb
vcr-1.10.2 features/support/vcr_cucumber_helpers.rb
vcr-1.10.0 features/support/vcr_cucumber_helpers.rb
vcr-1.9.0 features/support/vcr_cucumber_helpers.rb
vcr-1.8.0 features/support/vcr_cucumber_helpers.rb
vcr-1.7.2 features/support/vcr_cucumber_helpers.rb
vcr-1.7.1 features/support/vcr_cucumber_helpers.rb
vcr-1.7.0 features/support/vcr_cucumber_helpers.rb
vcr-1.6.0 features/support/vcr_cucumber_helpers.rb
vcr-1.5.1 features/support/vcr_cucumber_helpers.rb
vcr-1.5.0 features/support/vcr_cucumber_helpers.rb