Sha256: 6a0af2b3f61e5af6e93127482bf35541573d35667e97114bac67252d289abd31

Contents?: true

Size: 516 Bytes

Versions: 12

Compression:

Stored size: 516 Bytes

Contents

require 'helper'

describe Twitter::Error::ServerError do

  before do
    @client = Twitter::Client.new
  end

  Twitter::Error::ServerError.errors.each do |status, exception|
    context "when HTTP status is #{status}" do
      before do
        stub_get("/1.1/statuses/user_timeline.json").with(:query => {:screen_name => 'sferik'}).to_return(:status => status)
      end
      it "raises #{exception.name}" do
        expect{@client.user_timeline('sferik')}.to raise_error exception
      end
    end
  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
twitter-4.8.1 spec/twitter/error/server_error_spec.rb
twitter-4.8.0 spec/twitter/error/server_error_spec.rb
twitter-4.7.0 spec/twitter/error/server_error_spec.rb
twitter-4.6.2 spec/twitter/error/server_error_spec.rb
twitter-4.6.1 spec/twitter/error/server_error_spec.rb
twitter-4.6.0 spec/twitter/error/server_error_spec.rb
twitter-4.5.0 spec/twitter/error/server_error_spec.rb
twitter-4.4.4 spec/twitter/error/server_error_spec.rb
twitter-4.4.3 spec/twitter/error/server_error_spec.rb
twitter-4.4.2 spec/twitter/error/server_error_spec.rb
twitter-4.4.1 spec/twitter/error/server_error_spec.rb
twitter-4.4.0 spec/twitter/error/server_error_spec.rb