Sha256: 0bd7a92e8c9b7341ca1646f9ca5d2075cc527d4007eb76e7c40c8f188c3384c0

Contents?: true

Size: 783 Bytes

Versions: 7

Compression:

Stored size: 783 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, File.join(client.domain, url))
end

def stub_post(client, url)
  stub_request(:post, File.join(client.domain, url))
end

def stub_put(client, url)
  stub_request(:put, File.join(client.domain, url))
end

def stub_delete(client, url)
  stub_request(:delete, File.join(client.domain, url))
end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
footrest-0.4.1 spec/spec_helper.rb
footrest-0.3.1 spec/helper.rb
footrest-0.3.0 spec/helper.rb
footrest-0.2.2 spec/helper.rb
footrest-0.2.0 spec/helper.rb
footrest-0.1.3 spec/helper.rb
footrest-0.1.2 spec/helper.rb