       {err,token} = {}
 
       before (done) ->
-        sinon.stub fs, 'readFileSync', ->
+        sinon.stub(fs, 'readFileSync').callsFake( ->
           toString: ->
-            ''
+            '')
         sinon.stub fs, 'writeFileSync'
 
         setup.readSetupToken (error, setupToken) ->

      {err,token} = {}

      before (done) ->
        sinon.stub fs, 'readFileSync', ->
          toString: ->
            '        '
        sinon.stub fs, 'writeFileSync'

        setup.readSetupToken (error, setupToken) ->

      {err,token} = {}

      before (done) ->
        sinon.stub(fs, 'readFileSync').callsFake( ->
          throw new Error())
        sinon.stub fs, 'writeFileSync'

        setup.readSetupToken (error, setupToken) ->
