Browse Source

Fix unit tests

tags/v0.6.0
Chris Smith 5 years ago
parent
commit
cd952f3b79
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      src/test/kotlin/com/dmdirc/ktirc/IrcClientTest.kt

+ 5
- 0
src/test/kotlin/com/dmdirc/ktirc/IrcClientTest.kt View File

105
         client.onEvent(mockEventHandler)
105
         client.onEvent(mockEventHandler)
106
         readLineChannel.close()
106
         readLineChannel.close()
107
 
107
 
108
+        // Horrible hacks to make sure we've disconnected.
109
+        while (client.serverState.status != ServerStatus.Disconnected) {
110
+            delay(10)
111
+        }
112
+
108
         val captor = argumentCaptor<ServerDisconnected>()
113
         val captor = argumentCaptor<ServerDisconnected>()
109
         verify(mockEventHandler, timeout(500).atLeast(2)).invoke(captor.capture())
114
         verify(mockEventHandler, timeout(500).atLeast(2)).invoke(captor.capture())
110
         assertEquals(TestConstants.time, captor.lastValue.time)
115
         assertEquals(TestConstants.time, captor.lastValue.time)

Loading…
Cancel
Save