Sha256: 4883afe67d677a3e07dba0e5cef4220c96c4939ddd53cd3a506f32221750b425

Contents?: true

Size: 758 Bytes

Versions: 6

Compression:

Stored size: 758 Bytes

Contents

require 'rspec'
require_relative '../lib/restful_resource'
require_relative 'fixtures'

RSpec.configure do |config|
  config.color = true
  config.formatter = :progress
end


def expect_get(url, response)
  expect(@mock_http).to receive(:get).with(url).and_return(response)
end

def expect_put(url, response, data: {})
  expect(@mock_http).to receive(:put).with(url, data: data).and_return(response)
end

def expect_put_with_unprocessable_entity(url, response, data: {})
  rest_client_response = OpenStruct.new({body: response.body, headers: response.headers, code: response.status})
  exception = RestfulResource::HttpClient::UnprocessableEntity.new(rest_client_response)
  expect(@mock_http).to receive(:put).with(url, data: data).and_raise(exception)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
restful_resource-0.8.13 spec/spec_helper.rb
restful_resource-0.8.12 spec/spec_helper.rb
restful_resource-0.8.11 spec/spec_helper.rb
restful_resource-0.8.10 spec/spec_helper.rb
restful_resource-0.8.9 spec/spec_helper.rb
restful_resource-0.8.8 spec/spec_helper.rb