     it "recognises the client's state after boot", ->
       expect(clientStatus()).toEqual [true, true, false]
 
+    it "emits a connection event", ->
+      expect(connectSpy.calls.length).toBe(1)
+
   describe "while the client is active", ->
 
     it "can send and receive nested objects, strings and arrays", ->

          expect(x).toBe(2)

    describe "when callbacks are pending", ->
      cbs = null
      it "enters loading state", ->
        cbs = (evalsimple("peakflops(1000)") for i in [1..5])
        expect(client.isWorking()).toBe(true)

      it "stops loading after they are done", ->
        for cb in cbs

      waitsFor (done) ->
        evalsimple('exit()').catch -> done()

    it "resets the working state", ->
      expect(client.isWorking()).toBe(false)

    it "emits a disconnection event", ->
      expect(disconnectSpy.calls.length).toBe(1)

    it "recognises the client's state after exit", ->
      expect(clientStatus()).toEqual [false, false, false]
