       stream.on 'end', ->
         expect(print.log).to.have.been.calledWith "Hello #{colors.magenta path.relative process.cwd(), filepath}"
         done()
+        return
 
       stream.write new Vinyl path: filepath
       stream.end()
+      return
 

describe 'gulp-print', ->
  beforeEach ->
    sinon.stub print, 'log'

  afterEach ->
    print.log.restore()

  describe 'passing formatting function', ->
    it 'logs file path using default formatter', (done) ->

      stream.on 'end', ->
        expect(print.log).to.have.been.calledWith colors.magenta path.relative process.cwd(), filepath
        done()
        return

      stream.write new Vinyl path: filepath
      stream.end()
      return

    it 'logs file paths using custom formatter', (done) ->
      stream = print (filepath) -> "Hello #{filepath}"
