 
     if not process.platform.match /^win/
       it 'returns paths for a named sourcefile with default config', ->
-        atom.project.setPaths([PU+'/Project1', PU+'/Project2'])
-
-        ret = lb.getPaths(PU+'/Project1/source/dira/fauxfile.js',config)
-
-        expect(ret.sourceFile).to.equal(PU+'/Project1/source/dira/fauxfile.js')
-        expect(ret.sourceFileDir).to.equal(PU+'/Project1/source/dira')
-        expect(ret.mapFile).to.equal(PU+'/Project1/source/dira/fauxfile.js.map')
-        expect(ret.transpiledFile).to.equal(PU+'/Project1/source/dira/fauxfile.js')
-        expect(ret.sourceRoot).to.equal(PU+'/Project1')
-        expect(ret.projectPath).to.equal(PU+'/Project1')
+        tempProj1 = temp.mkdirSync()
+        tempProj2 = temp.mkdirSync()
+        atom.project.setPaths([tempProj1,tempProj2])
+
+        ret = lb.getPaths(tempProj1+'/source/dira/fauxfile.js',config)
+
+        expect(ret.sourceFile).to.equal(tempProj1+'/source/dira/fauxfile.js')
+        expect(ret.sourceFileDir).to.equal(tempProj1+'/source/dira')
+        expect(ret.mapFile).to.equal(tempProj1+'/source/dira/fauxfile.js.map')
+        expect(ret.transpiledFile).to.equal(tempProj1+'/source/dira/fauxfile.js')
+        expect(ret.sourceRoot).to.equal(tempProj1)
+        expect(ret.projectPath).to.equal(tempProj1)
 
       it 'returns paths config with target & source paths set', ->
-        atom.project.setPaths([PU+'/Project1', PU+'/Project2'])
+        tempProj1 = temp.mkdirSync()
+        tempProj2 = temp.mkdirSync()
+        atom.project.setPaths([tempProj1,tempProj2])
         config.babelSourcePath = '/source' # with dir prefix
         config.babelMapsPath ='mapspath' # and without
         config.babelTranspilePath = '/transpath'
 
-        ret = lb.getPaths(PU+'/Project1/source/dira/fauxfile.js',config)
-
-        expect(ret.sourceFile).to.equal(PU+'/Project1/source/dira/fauxfile.js')
-        expect(ret.sourceFileDir).to.equal(PU+'/Project1/source/dira')
-        expect(ret.mapFile).to.equal(PU+'/Project1/mapspath/dira/fauxfile.js.map')
-        expect(ret.transpiledFile).to.equal(PU+'/Project1/transpath/dira/fauxfile.js')
-        expect(ret.sourceRoot).to.equal(PU+'/Project1/source')
-        expect(ret.projectPath).to.equal(PU+'/Project1')
+        ret = lb.getPaths(tempProj1+'/source/dira/fauxfile.js',config)
+
+        expect(ret.sourceFile).to.equal(tempProj1+'/source/dira/fauxfile.js')
+        expect(ret.sourceFileDir).to.equal(tempProj1+'/source/dira')
+        expect(ret.mapFile).to.equal(tempProj1+'/mapspath/dira/fauxfile.js.map')
+        expect(ret.transpiledFile).to.equal(tempProj1+'/transpath/dira/fauxfile.js')
+        expect(ret.sourceRoot).to.equal(tempProj1+'/source')
+        expect(ret.projectPath).to.equal(tempProj1)
 
       it 'returns correct paths with project in root directory', ->
+        tempProj1 = temp.mkdirSync()
+        tempProj2 = temp.mkdirSync()
         atom.project.setPaths(['/'])
         config.babelSourcePath = 'source'
         config.babelMapsPath ='mapspath'

path = require 'path'
defaultConfig = require './default-config'
grammarTest = require 'atom-grammar-test'

LB = 'language-babel'
# we use atom setPaths in this spec. setPaths checks if directories exist

# were no found, atom sets the directory to the full name.
# We need some prefix directory faux names for posix and windows to ensure
# we always get a project name we set

describe 'language-babel', ->
  lb = null
  config =  {}
  beforeEach ->
    temp.cleanup()
    waitsForPromise ->
      atom.packages.activatePackage(LB)
    config = JSON.parse JSON.stringify defaultConfig
