Sha256: 120df2fa001fde8d7b212f75c54000153136f9f96bae6cc2a40fb39dd0176289

Contents?: true

Size: 759 Bytes

Versions: 37

Compression:

Stored size: 759 Bytes

Contents

require 'active_support/core_ext/module'
require 'bearcat'
require 'rspec'
require 'webmock/rspec'
require 'json'
require 'pry'

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

37 entries across 37 versions & 1 rubygems

Version Path
bearcat-1.5.13 spec/helper.rb
bearcat-1.5.12 spec/helper.rb
bearcat-1.5.11 spec/helper.rb
bearcat-1.5.10 spec/helper.rb
bearcat-1.5.9 spec/helper.rb
bearcat-1.5.8 spec/helper.rb
bearcat-1.5.7 spec/helper.rb
bearcat-1.5.6 spec/helper.rb
bearcat-1.5.5 spec/helper.rb
bearcat-1.5.4 spec/helper.rb
bearcat-1.5.3 spec/helper.rb
bearcat-1.5.2 spec/helper.rb
bearcat-1.5.0 spec/helper.rb
bearcat-1.5.0.beta4 spec/helper.rb
bearcat-1.5.0.beta3 spec/helper.rb
bearcat-1.5.0.beta2 spec/helper.rb
bearcat-1.5.0.beta1 spec/helper.rb