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,6 +105,11 @@ internal class IrcClientImplTest {
105 105
         client.onEvent(mockEventHandler)
106 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 113
         val captor = argumentCaptor<ServerDisconnected>()
109 114
         verify(mockEventHandler, timeout(500).atLeast(2)).invoke(captor.capture())
110 115
         assertEquals(TestConstants.time, captor.lastValue.time)

Loading…
Cancel
Save