Allow GitRepository tests to pass on Win32

This commit is contained in:
Damien Guard 2016-11-21 22:41:11 -08:00
parent 48b16a4633
commit 2014b2aee0
No known key found for this signature in database
GPG Key ID: DC14FA2FB1465DB6

View File

@ -29,10 +29,15 @@ describe "GitRepository", ->
expect(-> new GitRepository(path.join(temp.dir, 'nogit.txt'))).toThrow()
describe ".getPath()", ->
it "returns the repository path for a .git directory path", ->
it "returns the repository path for a .git directory path with a file", ->
return if process.platform is 'win32' #Win32TestFailures - libgit2 does not detect files in .git folders
repo = new GitRepository(path.join(__dirname, 'fixtures', 'git', 'master.git', 'HEAD'))
expect(repo.getPath()).toBe path.join(__dirname, 'fixtures', 'git', 'master.git')
it "returns the repository path for a .git directory path with a directory", ->
repo = new GitRepository(path.join(__dirname, 'fixtures', 'git', 'master.git', 'objects'))
expect(repo.getPath()).toBe path.join(__dirname, 'fixtures', 'git', 'master.git')
it "returns the repository path for a repository path", ->
repo = new GitRepository(path.join(__dirname, 'fixtures', 'git', 'master.git'))
expect(repo.getPath()).toBe path.join(__dirname, 'fixtures', 'git', 'master.git')
@ -154,7 +159,7 @@ describe "GitRepository", ->
describe ".destroy()", ->
it "throws an exception when any method is called after it is called", ->
repo = new GitRepository(require.resolve('./fixtures/git/master.git/HEAD'))
repo = new GitRepository(path.join(__dirname, 'fixtures', 'git', 'master.git'))
repo.destroy()
expect(-> repo.getShortHead()).toThrow()