spec/slack/real_time/client_spec.rb in slack-ruby-client-0.14.3 vs spec/slack/real_time/client_spec.rb in slack-ruby-client-0.14.4

- old
+ new

@@ -40,10 +40,24 @@ expect(client.token).to eq 'local token' expect(client.web_client.token).to eq 'local token' end end end + context 'websocket_ping_timer' do + context 'with defaults' do + let(:client) { Slack::RealTime::Client.new } + it 'defaults to websocket_ping / 2' do + expect(client.websocket_ping_timer).to eq 15 + end + end + context 'with websocket_ping value changed' do + let(:client) { Slack::RealTime::Client.new(websocket_ping: 22) } + it 'defaults to websocket_ping / 2' do + expect(client.websocket_ping_timer).to eq 11 + end + end + end context 'client with a full store', vcr: { cassette_name: 'web/rtm_start', allow_playback_repeats: true } do let(:client) { Slack::RealTime::Client.new(store_class: Slack::RealTime::Stores::Store) } let(:url) { 'wss://ms173.slack-msgs.com/websocket/lqcUiAvrKTP-uuid=' } describe '#start!' do let(:socket) { double(Slack::RealTime::Socket, connected?: true) } @@ -310,9 +324,18 @@ it "sets #{key}" do expect(client.send(key)).to_not eq Slack::RealTime::Config.send(key) expect(client.send(key)).to eq 'custom' end end + end + end + describe 'logger accessor' do + let(:client) { Slack::RealTime::Client.new } + it 'exposes public logger' do + expect(client.logger).to be_a(::Logger) + end + it 'exposes public logger=' do + expect { client.logger = nil }.not_to raise_error(NoMethodError) end end end context 'global config' do after do