spec/unit/realtime/presence_spec.rb in ably-0.8.15 vs spec/unit/realtime/presence_spec.rb in ably-1.0.0
- old
+ new
@@ -46,17 +46,18 @@
end
context 'subscriptions' do
let(:message_history) { Hash.new { |hash, key| hash[key] = 0 } }
let(:enter_action) { Ably::Models::PresenceMessage::ACTION.Enter }
+ let(:clone) { instance_double('Ably::Models::PresenceMessage', member_key: random_str, connection_id: random_str) }
let(:enter_message) do
- instance_double('Ably::Models::PresenceMessage', action: enter_action, connection_id: random_str, decode: true, member_key: random_str, to_safe_json: true)
+ instance_double('Ably::Models::PresenceMessage', action: enter_action, connection_id: random_str, decode: true, member_key: random_str, shallow_clone: clone)
end
let(:leave_message) do
- instance_double('Ably::Models::PresenceMessage', action: Ably::Models::PresenceMessage::ACTION.Leave, connection_id: random_str, decode: true, member_key: random_str, to_safe_json: true)
+ instance_double('Ably::Models::PresenceMessage', action: Ably::Models::PresenceMessage::ACTION.Leave, connection_id: random_str, decode: true, member_key: random_str, shallow_clone: clone)
end
let(:update_message) do
- instance_double('Ably::Models::PresenceMessage', action: Ably::Models::PresenceMessage::ACTION.Update, connection_id: random_str, decode: true, member_key: random_str, to_safe_json: true)
+ instance_double('Ably::Models::PresenceMessage', action: Ably::Models::PresenceMessage::ACTION.Update, connection_id: random_str, decode: true, member_key: random_str, shallow_clone: clone)
end
context '#subscribe' do
specify 'without a block raises an invalid ArgumentError' do
expect { subject.subscribe }.to raise_error ArgumentError