         try! fileManager.removeItemAtURL(tempRepo!)
     }
 
+    /**
+    Create and return a symlink
+    
+    :param: targetExist A boolean to indicate if the symlinc should point to an existing target.
+    
+    :returns: a tuple with NSURLs to the destination and symbolicLink
+    */
+    func setUpSymlink(targetExist: Bool) -> (destination: NSURL, symbolicLink: NSURL) {
+        let destination = NSURL(string: "sample_file", relativeToURL: self.tempRepo)
+        let symbolicLink = NSURL(string: "symlink", relativeToURL: self.tempRepo)
+        try! fileManager.createSymbolicLinkAtPath((symbolicLink?.path!)!, withDestinationPath: (destination?.path!)!)
+        if targetExist {
+            fileManager.createFileAtPath((destination?.path!)!, contents: nil, attributes: nil)
+        }
+        return (destination!, symbolicLink!)
+    }
+
     func testRepoRoot() {
         guard let repoPath = self.repo.repoRoot.path else {
             XCTFail("repoRoot is nil")

    }
    
    func testIsDirectory_brokenSymlink() {
        let symbolicLink = NSURL(string: "symlink", relativeToURL: self.tempRepo)
        try! fileManager.createSymbolicLinkAtURL(symbolicLink!, withDestinationURL: NSURL(string: "/blahonga", relativeToURL: self.tempRepo)!)
        XCTAssertFalse(self.repo.urlIsDirectory(symbolicLink))
    }
    
    func testIsDirectory_symlink() {
        let destination = NSURL(string: "sample_file", relativeToURL: self.tempRepo)
        let symbolicLink = NSURL(string: "symlink", relativeToURL: self.tempRepo)
        try! fileManager.createSymbolicLinkAtURL(symbolicLink!, withDestinationURL: destination!)
        XCTAssertFalse(self.repo.urlIsDirectory(symbolicLink))
    }
    
    func testIsSymlink_isFile() {

    }
    
    func testIsSymlink_brokenSymlink() {
        XCTAssertTrue(self.repo.urlIsSymlink(self.setUpSymlink(false).symbolicLink))
    }
    
    func testIsSymlink_symlink() {
        XCTAssertTrue(self.repo.urlIsSymlink(self.setUpSymlink(true).symbolicLink))
    }
    
    func testIsSymlink_doesNotExist() {
