Sha256: 0db3a9f7bd3aa4f67850d5ca65ad8648f227eb6d4dc5efe34319d6122b8a1770

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

require 'footrest'
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.domain}#{url}")
end

def stub_post(client, url)
  stub_request(:post, "#{client.domain}#{url}")
end

def stub_put(client, url)
  stub_request(:put, "#{client.domain}#{url}")
end

def stub_delete(client, url)
  stub_request(:delete, "#{client.domain}#{url}")
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
footrest-0.1 spec/helper.rb