Sha256: ff38854d75c2a91517e6b0cdc91537ddfb782d30a7469e282933073a38d6368c

Contents?: true

Size: 706 Bytes

Versions: 4

Compression:

Stored size: 706 Bytes

Contents

require 'spec_helper'

describe Ably::Realtime::Client, '#time', :event_machine do
  vary_by_protocol do
    let(:client) do
      Ably::Realtime::Client.new(api_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
        run_reactor do
          client.time do |time|
            expect(time).to be_within(2).of(Time.now)
            stop_reactor
          end
        end
      end

      it 'should return a deferrable object' do
        run_reactor do
          expect(client.time).to be_a(EventMachine::Deferrable)
          stop_reactor
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ably-rest-0.7.3 lib/submodules/ably-ruby/spec/acceptance/realtime/time_spec.rb
ably-0.7.2 spec/acceptance/realtime/time_spec.rb
ably-0.7.1 spec/acceptance/realtime/time_spec.rb
ably-0.7.0 spec/acceptance/realtime/time_spec.rb