Sha256: d489a564b62ef36ea138afc1ef440367285665ab1d896e46a964257478aa77e4
Contents?: true
Size: 772 Bytes
Versions: 2
Compression:
Stored size: 772 Bytes
Contents
require 'helper' describe Faraday::Response do before do @client = Octokit::Client.new end { 400 => Octokit::BadRequest, 401 => Octokit::Unauthorized, 403 => Octokit::Forbidden, 404 => Octokit::NotFound, 406 => Octokit::NotAcceptable, 500 => Octokit::InternalServerError, 501 => Octokit::NotImplemented, 502 => Octokit::BadGateway, 503 => Octokit::ServiceUnavailable, }.each do |status, exception| context "when HTTP status is #{status}" do before do stub_get('user/show/sferik'). to_return(:status => status) end it "should raise #{exception.name} error" do lambda do @client.user('sferik') end.should raise_error(exception) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
octokit-0.6.1 | spec/faraday/response_spec.rb |
octokit-0.6.0 | spec/faraday/response_spec.rb |