lib/submodules/ably-ruby/spec/acceptance/realtime/client_spec.rb in ably-rest-1.0.5 vs lib/submodules/ably-ruby/spec/acceptance/realtime/client_spec.rb in ably-rest-1.0.6
- old
+ new
@@ -132,11 +132,11 @@
end
end
context 'with a wildcard client_id token' do
subject { auto_close Ably::Realtime::Client.new(client_options) }
- let(:client_options) { default_options.merge(auth_callback: Proc.new { auth_token_object }, client_id: client_id) }
+ let(:client_options) { default_options.merge(auth_callback: lambda { |token_params| auth_token_object }, client_id: client_id) }
let(:rest_auth_client) { Ably::Rest::Client.new(default_options.merge(key: api_key)) }
let(:auth_token_object) { rest_auth_client.auth.request_token(client_id: '*') }
context 'and an explicit client_id in ClientOptions' do
let(:client_id) { random_str }
@@ -153,10 +153,10 @@
end
end
end
context 'and client_id omitted in ClientOptions' do
- let(:client_options) { default_options.merge(auth_callback: Proc.new { auth_token_object }) }
+ let(:client_options) { default_options.merge(auth_callback: lambda { |token_params| auth_token_object }) }
it 'uses the token provided clientId in the connection' do
connection.__incoming_protocol_msgbus__.subscribe(:protocol_message) do |protocol_message|
if protocol_message.action == :connected
expect(protocol_message.connection_details.client_id).to eql('*')