Skip to content

Commit 0d392f3

Browse files
committed
unbind_global test
1 parent b92020f commit 0d392f3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/java/com/pusher/client/channel/impl/ChannelImplTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ public void testEventIsNotPassedOnIfListenerHasUnboundFromEvent() {
163163

164164
verify(mockListener, never()).onEvent(any(PusherEvent.class));
165165
}
166+
@Test
167+
public void testEventIsNotPassedOnIfListenerHasUnboundFromGlobalEvent() {
168+
169+
channel.bind_global(mockListener);
170+
channel.unbind_global(mockListener);
171+
channel.onMessage(EVENT_NAME, "{\"event\":\"event1\",\"data\":\"{\\\"fish\\\":\\\"chips\\\"}\"}");
172+
173+
verify(mockListener, never()).onEvent(any(PusherEvent.class));
174+
}
166175

167176
@Test(expected = IllegalArgumentException.class)
168177
public void testBindWithNullEventNameThrowsException() {

0 commit comments

Comments
 (0)