 chai.use sinonChai 
 
 FrameBuffer = require '../lib/framebuffer.coffee'
-message = require '../lib/message'
+wire = require '../lib/wire'
 
 createFrame = (frameId, payload) ->
   frame = new Buffer(4 + 4 + payload.length)


  it 'empty internal buffer when all frames are consumed', ->
    frameBuffer = new FrameBuffer()
    data = createFrame message.FRAME_TYPE_RESPONSE, 'OK'
    
    frame = frameBuffer.consume data
    expect(frameBuffer._buffer).to.be.null


  it 'should parse multiple frames delivered in partials', ->
    frameBuffer = new FrameBuffer()
    first = createFrame wire.FRAME_TYPE_RESPONSE, 'OK'
    second = createFrame wire.FRAME_TYPE_RESPONSE, '{}'
    data = Buffer.concat [first, second]

    # First frame is 10 bytes long. Don't expect to get anything back.
