Sha256: 717a8f4457c3a15207c6d4bba0c6944fb9da90da4ebaf75f016b0a2218812b01
Contents?: true
Size: 845 Bytes
Versions: 1
Compression:
Stored size: 845 Bytes
Contents
# -*- encoding: utf-8 -*- require 'spec_helper' describe Faraday::Response do before do @client = TedApi::Client.new(api_key: 'foo') end { 400 => TedApi::BadRequest, 401 => TedApi::Unauthorized, 403 => TedApi::Forbidden, 404 => TedApi::NotFound, 406 => TedApi::NotAcceptable, 422 => TedApi::UnprocessableEntity, 500 => TedApi::InternalServerError, 501 => TedApi::NotImplemented, 502 => TedApi::BadGateway, 503 => TedApi::ServiceUnavailable, }.each do |status, exception| context "when HTTP status is #{status}" do before do stub_get('talks.json?api-key=foo'). to_return(:status => status) end it "should raise #{exception.name} error" do lambda do @client.talks end.should raise_error(exception) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ted_api-0.1 | spec/faraday/response_spec.rb |