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-1.0.13 spec/helper.rb
bearcat-1.0.12 spec/helper.rb
bearcat-1.0.11 spec/helper.rb
bearcat-1.0.10 spec/helper.rb
bearcat-1.0.9 spec/helper.rb
bearcat-1.0.8 spec/helper.rb
bearcat-1.0.7 spec/helper.rb
bearcat-1.0.6 spec/helper.rb
bearcat-1.0.5 spec/helper.rb
bearcat-1.0.4 spec/helper.rb
bearcat-1.0.3 spec/helper.rb
bearcat-1.0.2 spec/helper.rb
bearcat-1.0.1 spec/helper.rb
bearcat-1.0.0 spec/helper.rb
bearcat-0.9.22 spec/helper.rb
bearcat-0.9.20 spec/helper.rb
bearcat-0.9.19 spec/helper.rb
bearcat-0.9.18 spec/helper.rb
bearcat-0.9.17 spec/helper.rb
bearcat-0.9.16 spec/helper.rb