Sha256: 1e9aead43b7fff9e98e3c597365dfb21918f0b5cc8485d0227ed98cc5ab1752e
Contents?: true
Size: 938 Bytes
Versions: 13
Compression:
Stored size: 938 Bytes
Contents
RSpec.shared_context 'connected client' do |opts| let(:client) { Slack::RealTime::Client.new(opts || {}) } let(:ws) { double(Slack::RealTime::Concurrency::Mock::WebSocket) } let(:url) do Slack::RealTime.config.store_class == Slack::RealTime::Stores::Store ? 'wss://ms173.slack-msgs.com/websocket/lqcUiAvrKTP-uuid=' : 'wss://mpmulti-w5tz.slack-msgs.com/websocket/uid' end let(:socket) { double(Slack::RealTime::Socket, connected?: true) } before do Slack::RealTime.configure do |config| config.concurrency = Slack::RealTime::Concurrency::Mock config.store_class = (opts || {})[:store_class] || Slack::RealTime::Stores::Store end allow(Slack::RealTime::Socket).to receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket) allow(socket).to receive(:start_sync) allow(socket).to receive(:connect!) allow(ws).to receive(:on) client.start! end end
Version data entries
13 entries across 13 versions & 1 rubygems