Sha256: dc4f550f0835bf82eae95a52f02201c0efc89a8403db55138bb6fe2804591820

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')

require 'rubygems'
require 'rspec'
gem 'activesupport', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
require 'tinder'
require 'fakeweb'

FakeWeb.allow_net_connect = false

def fixture(name)
  File.read(File.dirname(__FILE__) + "/fixtures/#{name}")
end

def stub_connection(object, &block)
  @stubs ||= Faraday::Adapter::Test::Stubs.new

  object.connection.build do |conn|
    conn.use      Faraday::Request::ActiveSupportJson
    conn.adapter :test, @stubs
    conn.use      Tinder::FaradayResponse::RaiseOnAuthenticationFailure
    conn.use      Faraday::Response::ActiveSupportJson
    conn.use      Tinder::FaradayResponse::WithIndifferentAccess
  end

  block.call(@stubs)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tinder-1.4.4 spec/spec_helper.rb