   client.on 'status', onStatus
   client.connect()
 
+runtimeDefinition = (options) ->
+  def =
+    protocol: 'websocket'
+    address: "ws://localhost:#{options.port}"
+  return def
+
 setupAndConnect = (options, callback) ->
   mochacompat.setup options, (err, state, httpServer) ->
     return callback err if err
-    def =
-      protocol: 'websocket'
-      address: "ws://localhost:#{options.port}"
+    def = runtimeDefinition options
     Transport = fbpClient.getTransport def.protocol
     client = new Transport def
 

          chai.expect(caseB.name).to.include 'sub sub topic'
          done()




describe 'Mocha compatibility runner', ->
  httpServer = null
  definition = null
  ru = null

  afterEach (done) ->
    if httpServer
      httpServer.close()
    if ru
      ru.disconnect done
    else
      done()

  it 'should implement the FBP runtime protocol', (done) ->
    options =
