diff --git a/spec/git-repository-provider-spec.coffee b/spec/git-repository-provider-spec.coffee index 15e1dcc60..176acee7d 100644 --- a/spec/git-repository-provider-spec.coffee +++ b/spec/git-repository-provider-spec.coffee @@ -56,6 +56,21 @@ describe "GitRepositoryProvider", -> provider.repositoryForDirectory(directory).then (result) -> expect(result).toBe null + describe "when specified a Directory with a valid gitfile-linked repository", -> + it "returns a Promise that resolves to a GitRepository", -> + waitsForPromise -> + provider = new GitRepositoryProvider atom.project + gitDirPath = path.join(__dirname, 'fixtures/git/master.git') + workDirPath = temp.mkdirSync('git-workdir') + fs.writeFileSync(path.join(workDirPath, '.git'), 'gitdir: ' + gitDirPath+'\n') + + directory = new Directory workDirPath + provider.repositoryForDirectory(directory).then (result) -> + expect(result).toBeInstanceOf GitRepository + expect(provider.pathToRepository[result.getPath()]).toBeTruthy() + expect(result.statusTask).toBeTruthy() + expect(result.getType()).toBe 'git' + describe "when specified a Directory without existsSync()", -> directory = null provider = null