Sha256: 979aa553ff4e9f83c7755ead8362977207c8a5f3d79d4678afa1be403f785e38

Contents?: true

Size: 710 Bytes

Versions: 8

Compression:

Stored size: 710 Bytes

Contents

# encoding: UTF-8
$:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')

require 'rspec'
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 |builder|
    builder.use     FaradayMiddleware::EncodeJson
    builder.use     FaradayMiddleware::Mashify
    builder.use     FaradayMiddleware::ParseJson
    builder.use     Faraday::Response::RemoveWhitespace
    builder.use     Faraday::Response::RaiseOnAuthenticationFailure
    builder.adapter :test, @stubs
  end

  block.call(@stubs)
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
tinder-1.10.1 spec/spec_helper.rb
tinder-1.10.0 spec/spec_helper.rb
tinder-1.9.4 spec/spec_helper.rb
tinder-1.9.3 spec/spec_helper.rb
sj-tinder-1.9.3 spec/spec_helper.rb
tinder-1.9.2 spec/spec_helper.rb
tinder-1.9.1 spec/spec_helper.rb
tinder-1.9.0 spec/spec_helper.rb