Sha256: 20c509381b317c4ef3fb806be62065e0f5f77e1535726972cefa951544f0bffc

Contents?: true

Size: 636 Bytes

Versions: 1

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(PromisePool::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(PromisePool::Timer).new(99, is_a(Timeout::Error))
    RC::Facebook.new(:timeout => 1).get('me', {}, :timeout => 99).
      should.eq true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rest-more-3.4.0 test/facebook/test_timeout.rb