Sha256: 34efe4fb6923d4e8dea304b22322e8009d995af1af5d368111e34e430912c3c4

Contents?: true

Size: 704 Bytes

Versions: 22

Compression:

Stored size: 704 Bytes

Contents

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

WebMock.disable_net_connect!

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

22 entries across 22 versions & 1 rubygems

Version Path
bearcat-0.9.15 spec/helper.rb
bearcat-0.9.14 spec/helper.rb