Sha256: acf8fd83d5b68f2195d4f242a64b848b3886869b32fa57d805cd0b870443b279

Contents?: true

Size: 638 Bytes

Versions: 3

Compression:

Stored size: 638 Bytes

Contents

require 'rest-more/test'

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

  should '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

  should '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

3 entries across 3 versions & 1 rubygems

Version Path
rest-more-3.2.0 test/facebook/test_timeout.rb
rest-more-3.1.0 test/facebook/test_timeout.rb
rest-more-3.0.0 test/facebook/test_timeout.rb