 
 describe "GitCommit", ->
   describe "a regular commit", ->
-    commit = null
-    beforeEach ->
+    it "gets the current pane", ->
       setupMocks()
-      commit = GitCommit repo
-
-    it "saves the current pane", ->
+      GitCommit repo
       expect(atom.workspace.getActivePane).toHaveBeenCalled()
 
     describe "::start", ->
       beforeEach ->
         atom.config.set "git-plus.openInPane", false
+        setupMocks()
         waitsForPromise ->
-          commit.start()
+          GitCommit(repo).start()
 
       it "gets the commentchar from configs", ->
         expect(git.cmd).toHaveBeenCalledWith ['config', '--get', 'core.commentchar']

  getItems: -> [
    getURI: -> commitFilePath
  ]

setupMocks = ->
  spyOn(currentPane, 'activate')

      it "gets the commit template from git configs", ->
        expect(git.cmd).toHaveBeenCalledWith ['config', '--get', 'commit.template']

      it "writes to a file", ->
        argsTo_fsWriteFile = fs.writeFileSync.mostRecentCall.args
        expect(argsTo_fsWriteFile[0]).toEqual commitFilePath

      it "shows the file", ->
        expect(atom.workspace.open).toHaveBeenCalled()
