Sha256: e7e1685bb7586be94e17352dfcf78b56b7d4441167550c9a5fd3c4f00103016f

Contents?: true

Size: 1022 Bytes

Versions: 19

Compression:

Stored size: 1022 Bytes

Contents

# encoding: utf-8
require 'spec_helper'
require 'shared/client_initializer_behaviour'

describe Ably::Realtime::Client do
  subject do
    Ably::Realtime::Client.new(client_options)
  end

  it_behaves_like 'a client initializer'

  context 'delegation to the REST Client' do
    let(:client_options) { { key: 'appid.keyuid:keysecret', auto_connect: false } }

    it 'passes on the options to the initializer' do
      rest_client = instance_double('Ably::Rest::Client', auth: instance_double('Ably::Auth'), options: client_options)
      expect(Ably::Rest::Client).to receive(:new).with(client_options).and_return(rest_client)
      subject
    end

    context 'for attribute' do
      [:environment, :use_tls?, :log_level, :custom_host].each do |attribute|
        specify "##{attribute}" do
          expect(subject.rest_client).to receive(attribute)
          subject.public_send attribute
        end
      end
    end
  end

  after(:all) do
    sleep 1 # let realtime library shut down any open clients
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
ably-rest-0.8.15 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-0.8.15 spec/unit/realtime/client_spec.rb
ably-rest-0.9.3 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-rest-0.9.2 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-rest-0.9.1 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-rest-0.9.0 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-rest-0.8.14 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-0.8.14 spec/unit/realtime/client_spec.rb
ably-rest-0.8.13 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-0.8.13 spec/unit/realtime/client_spec.rb
ably-0.8.12 spec/unit/realtime/client_spec.rb
ably-0.8.11 spec/unit/realtime/client_spec.rb
ably-0.8.10 spec/unit/realtime/client_spec.rb
ably-rest-0.8.9 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb
ably-0.8.9 spec/unit/realtime/client_spec.rb
ably-0.8.8 spec/unit/realtime/client_spec.rb
ably-0.8.7 spec/unit/realtime/client_spec.rb
ably-0.8.6 spec/unit/realtime/client_spec.rb
ably-rest-0.8.6 lib/submodules/ably-ruby/spec/unit/realtime/client_spec.rb