 
 pathToRepoFile = Path.get "~/.atom/packages/git-plus/lib/git.coffee"
 pathToSubmoduleFile = Path.get "~/.atom/packages/git-plus/spec/foo/foo.txt"
+
+mockRepo = {
+  getWorkingDirectory: () -> 'dir'
+  refreshStatus: () -> undefined
+}
 
 describe "Git-Plus git module", ->
   describe "git.getRepo", ->

    it "calls git.cmd with ['add', '--all', {fileName}]", ->
      spyOn(git, 'cmd').andCallFake () -> Promise.resolve true
      waitsForPromise ->
        repo = git.getSubmodule(pathToSubmoduleFile)
        git.add(repo, file: pathToSubmoduleFile).then (success) ->
          expect(git.cmd).toHaveBeenCalledWith(['add', '--all', pathToSubmoduleFile], cwd: repo.getWorkingDirectory())

    it "calls git.cmd with ['add', '--all', '.'] when no file is specified", ->
      spyOn(git, 'cmd').andCallFake () -> Promise.resolve true
      waitsForPromise ->
        repo = git.getSubmodule(pathToSubmoduleFile)
        git.add(repo).then (success) ->
          expect(git.cmd).toHaveBeenCalledWith(['add', '--all', '.'], cwd: repo.getWorkingDirectory())

    it "calls git.cmd with ['add', '--update'...] when update option is true", ->
      spyOn(git, 'cmd').andCallFake () -> Promise.resolve true
      waitsForPromise ->
        repo = git.getSubmodule(pathToSubmoduleFile)
        git.add(repo, update: true).then (success) ->
          expect(git.cmd).toHaveBeenCalledWith(['add', '--update', '.'], cwd: repo.getWorkingDirectory())

  describe "git.reset", ->
    it "resets and unstages all files", ->
      spyOn(git, 'cmd').andCallFake () -> Promise.resolve true
      waitsForPromise ->
        repo = git.getSubmodule(pathToSubmoduleFile)
        git.reset(repo).then () ->
          expect(git.cmd).toHaveBeenCalledWith ['reset', 'HEAD'], cwd: repo.getWorkingDirectory()

  describe "git.stagedFiles", ->
    it "returns an empty array when there are no staged files", ->

        git.status(git.getSubmodule(pathToSubmoduleFile)).then () -> expect(true).toBeTruthy()

    describe "git.refresh", ->
      it "calls git.cmd with 'add' and '--refresh' arguments for each repo in project", ->
        spyOn(git, 'cmd').andCallFake () ->
          args = git.cmd.mostRecentCall.args[0]
