Sha256: 74dd3d22a42bb8c511b3e801bdfb6ff9074abc3791ef5299470cba28ad953873

Contents?: true

Size: 816 Bytes

Versions: 2

Compression:

Stored size: 816 Bytes

Contents

require 'footrest'
require 'bearcat'
require 'rspec'
require 'webmock/rspec'
require 'json'

WebMock.disable_net_connect!

RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

def fixture(file)
  File.new(File.join(File.expand_path("../fixtures", __FILE__), file))
end

def stub_get(client, url)
  stub_request(:get, "#{client.config[:prefix]}#{url}")
end

def stub_post(client, url)
  stub_request(:post, "#{client.config[:prefix]}#{url}")
end

def stub_put(client, url)
  stub_request(:put, "#{client.config[:prefix]}#{url}")
end

def stub_delete(client, url)
  stub_request(:delete, "#{client.config[:prefix]}#{url}")
end

def json_response(file)
  {
    :body => fixture(file),
    :headers => {
      :content_type => 'application/json; charset=utf-8'
    }
  }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bearcat-0.1.1 spec/helper.rb
bearcat-0.1 spec/helper.rb