   it 'forwards errors from on error', (done) ->
     world.given.fakeWebSocketConstructor()
 
-    testSubject = transactionStream(world.fakeWebSocketConstructor, 'gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q')
+    stream = transactionStream(world.fakeWebSocketConstructor, 'gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q')
 
     clock.tick 50
 
     fakeError = new Error()
 
-    testSubject.on 'error', (error) ->
+    stream.on 'error', (error) ->
       assert.equal fakeError, error
       done()
 


    clock.tick 100

    testSubject.on 'error', -> assert.fail('should not call error')

    world.fakeWebSocketInstance.send.yield null

    assert(world.fakeWebSocketInstance.send.calledWith(
      JSON.stringify({ "command" : "subscribe",   "accounts" : [ "gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q" ] })))

    testSubject.on 'data', (data) ->
      assert.deepEqual data,
        from: "gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q"
        to: "gM8ZuCaGB7GkCiLz7rW941boyVT2vW1ppT"

  it 'subscribes to account and streams it', (done) ->
    world.given.fakeWebSocketConstructor()

    stream = transactionStream(world.fakeWebSocketConstructor, 'gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q')

    assert(world.fakeWebSocketConstructor.calledWithNew())
    assert(world.fakeWebSocketConstructor.calledWith('ws://live.stellar.org:9001'))
