Skip to content

Commit 3a9df01

Browse files
committed
Fixed concurrency specs.
1 parent da457b9 commit 3a9df01

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

spec/slack/real_time/concurrency/celluloid_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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)

spec/slack/real_time/concurrency/eventmachine_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
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

0 commit comments

Comments
 (0)