 path = require 'path'
 
 describe "fs util", ->
-  testPath = "/home/test/github/coffee-compile/lib/fs-util.coffee"
+  testPath = __dirname + "/lib/fs-util.coffee"
 
   beforeEach ->
     atom.project.setPaths([__dirname])

    it "should not be relative to cwd and return false", ->
      atom.config.set("coffee-compile.cwd", "spec")
      atom.config.set("coffee-compile.source", ["."])
      cwdTestPath = "/home/test/github/coffee-compile/lib/more/folder/fs-util.coffee"

      output = fsUtil.isPathInSrc cwdTestPath
      expect(output).toBe false

    it "should be relative to cwd and return true", ->
      atom.config.set("coffee-compile.cwd", "lib/")
      atom.config.set("coffee-compile.source", ["more/"])
      cwdTestPath = __dirname + "/lib/more/folder/fs-util.coffee"

      output = fsUtil.isPathInSrc cwdTestPath
      expect(output).toBe true
