       expect(pane.items).toEqual [item2]
 
   describe "::saveActiveItem()", ->
-    [pane, activeItemUri] = []
+    pane = null
 
     beforeEach ->
       pane = new Pane(items: [new Item("A")])
       spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
-      pane.activeItem.getUri = -> activeItemUri
 
     describe "when the active item has a uri", ->
       beforeEach ->
-        activeItemUri = "test"
+        pane.activeItem.uri = "test"
 
       describe "when the active item has a save method", ->
         it "saves the current item", ->

          expect(atom.showSaveDialogSync).not.toHaveBeenCalled()

  describe "::saveActiveItemAs()", ->
    [pane, activeItemUri] = []

    beforeEach ->
      pane = new Pane(items: [new Item("A")])
      spyOn(atom, 'showSaveDialogSync').andReturn('/selected/path')
      pane.activeItem.getUri = -> "test"

    describe "when the current item has a saveAs method", ->
      it "opens the save dialog and calls saveAs on the item with the selected path", ->
        pane.activeItem.saveAs = jasmine.createSpy("saveAs")
        pane.saveActiveItemAs()
        expect(atom.showSaveDialogSync).toHaveBeenCalledWith(activeItemUri)
        expect(pane.activeItem.saveAs).toHaveBeenCalledWith('/selected/path')

    describe "when the current item does not have a saveAs method", ->

          pane.saveActiveItem()

    describe "when the current item has no uri", ->
      describe "when the current item has a saveAs method", ->
        it "opens a save dialog and saves the current item as the selected path", ->
          pane.activeItem.saveAs = jasmine.createSpy("saveAs")
