Sha256: c3bcd410d1ae738fc01da26dcb65873461422821247eb1e4813ca21b666eea77

Contents?: true

Size: 636 Bytes

Versions: 5

Compression:

Stored size: 636 Bytes

Contents

require 'rest-more/test'

describe RC::Facebook do
  after do
    WebMock.reset!
    Muack.verify
  end

  would 'respect timeout' do
    stub_request(:get, 'https://graph.facebook.com/me').
      to_return(:body => '{}')
    any_instance_of(RC::Timeout::Timer){ |timer|
      mock(timer).on_timeout
    }
    RC::Facebook.new.get('me').should.eq({})
  end

  would 'override timeout' do
    stub_request(:get, 'https://graph.facebook.com/me').
      to_return(:body => 'true')
    mock(RC::Timeout::Timer).new(99, is_a(Timeout::Error))
    RC::Facebook.new(:timeout => 1).get('me', {}, :timeout => 99).
      should.eq true
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rest-more-3.3.4 test/facebook/test_timeout.rb
rest-more-3.3.3 test/facebook/test_timeout.rb
rest-more-3.3.2 test/facebook/test_timeout.rb
rest-more-3.3.1 test/facebook/test_timeout.rb
rest-more-3.3.0 test/facebook/test_timeout.rb