Sha256: caa4263d04f86bfb8a766e2db4257e794593701ac35ec2d8678608a135c5866d

Contents?: true

Size: 787 Bytes

Versions: 34

Compression:

Stored size: 787 Bytes

Contents

require 'spec_helper'

describe Ably::Rest::Client, '#time' do
  vary_by_protocol do
    let(:client) do
      Ably::Rest::Client.new(key: api_key, environment: environment, protocol: protocol)
    end

    describe 'fetching the service time' do
      it 'should return the service time as a Time object' do
        expect(client.time).to be_within(2).of(Time.now)
      end

      context 'with reconfigured HTTP timeout' do
        let(:client) do
          Ably::Rest::Client.new(http_request_timeout: 0.0001, key: api_key, environment: environment, protocol: protocol, log_retries_as_info: true)
        end

        it 'should raise a timeout exception' do
          expect { client.time }.to raise_error Ably::Exceptions::ConnectionTimeout
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
ably-rest-1.1.5 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.5 spec/acceptance/rest/time_spec.rb
ably-rest-1.1.4 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.4 spec/acceptance/rest/time_spec.rb
ably-rest-1.1.4.rc lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.4.rc spec/acceptance/rest/time_spec.rb
ably-rest-1.1.3 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.3 spec/acceptance/rest/time_spec.rb
ably-rest-1.1.2 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.2 spec/acceptance/rest/time_spec.rb
ably-rest-1.1.2.rc1 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.1 spec/acceptance/rest/time_spec.rb
ably-rest-1.1.0 lib/submodules/ably-ruby/spec/acceptance/rest/time_spec.rb
ably-1.1.0 spec/acceptance/rest/time_spec.rb