       it 'suppresses unexpected errors when set to false', ->
         gotError = false
         waitsForPromise ->
-          helpers.exec(__dirname + '/fixtures/stderr.sh', [], throwOnStdErr: false).catch(->
+          helpers.exec("#{__dirname}/fixtures/stderr.sh", [], throwOnStdErr: false).catch(->
             gotError = true
           ).then ->
             expect(gotError).toBe(false)

        helpers.findFile()
      .toThrow()
    it 'works', ->
      expect(helpers.findFile(__dirname, 'package.json')).toBe(fs.realpathSync(__dirname + '/../package.json'))

      expect( -> helpers.execNode()).toThrow()
    it 'works', ->
      waitsForPromise ->
        helpers.execNode("#{__dirname}/fixtures/something.js").then (data) ->
          expect(data).toBe('STDOUT')
      waitsForPromise ->
        helpers.exec('cat', [testFile]).then (text) ->
          expect(text).toBe(testContents)
    it 'lets you choose streams', ->
      waitsForPromise ->
        helpers.execNode("#{__dirname}/fixtures/stderr.js", [], {stream: 'stderr'}).then (data) ->
          expect(data).toBe('STDERR')
      waitsForPromise ->
        helpers.exec('cat', [testFile], stream: 'stderr').then (text) ->
          expect(text).toBe('')
    it 'accepts stdin', ->
      waitsForPromise ->
        helpers.execNode("#{__dirname}/fixtures/something.js", ['input'], {stream: 'stdout', stdin: 'Wow'}).then (data) ->
          expect(data).toBe('STDOUTWow')
      waitsForPromise ->
        helpers.exec('cat', [], stream: 'stdout', stdin: testContents).then (text) ->
          expect(text).toBe(testContents)
    it "throws if stderr is written to but wasn't expected", ->
      waitsForPromise ->
        helpers.execNode("#{__dirname}/fixtures/stderr.js", []).catch (message) ->
          expect(message).toBe('STDERR')
      waitsForPromise ->
        helpers.exec("#{__dirname}/fixtures/stderr.sh", []).catch (message) ->
          expect(message).toBe("STDERR\n")

    describe 'throwOnStdErr option', ->
      it 'throws unexpected error when set to true', ->
        gotError = false
        waitsForPromise ->
          helpers.exec("#{__dirname}/fixtures/stderr.sh", [], throwOnStdErr: true).catch( (message) ->
            gotError = true
            expect(message).toBe("STDERR\n")
          ).then ->
