File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
spec/slack/real_time/concurrency Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,17 @@ def read
7878
7979 describe '#disconnect!' do
8080 it 'closes and nils the websocket' do
81+ expect ( ws ) . to receive ( :emit )
8182 expect ( ws ) . to receive ( :close )
8283 socket . disconnect!
8384 end
8485 end
8586
8687 context 'consumes data' do
88+ let ( :tcp_socket ) { double ( ::Celluloid ::IO ::SSLSocket , connect : true ) }
89+ before do
90+ allow_any_instance_of ( described_class ) . to receive ( :build_socket ) . and_return ( tcp_socket )
91+ end
8792 it 'runs' do
8893 expect ( ws ) . to receive ( :emit )
8994 expect ( ws ) . to receive ( :start )
Original file line number Diff line number Diff line change 2727 describe '#disconnect!' do
2828 it 'closes and nils the websocket' do
2929 socket . instance_variable_set ( '@driver' , ws )
30+ expect ( ws ) . to receive ( :emit ) . with ( :close )
3031 expect ( ws ) . to receive ( :close )
3132 socket . disconnect!
3233 end
You can’t perform that action at this time.
0 commit comments