 
     it "can serialize and deserialize the pane and all its items", ->
       newPane = pane.testSerialization()
-      expect(newPane.items).toEqual pane.items
+      expect(newPane.getItems()).toEqual pane.getItems()
 
     it "restores the active item on deserialization", ->
       pane.activateItemAtIndex(1)
       newPane = pane.testSerialization()
-      expect(newPane.activeItem).toEqual newPane.items[1]
+      expect(newPane.getActiveItem()).toEqual newPane.itemAtIndex(1)
 
     it "does not include items that cannot be deserialized", ->
       spyOn(console, 'warn')

  describe "::moveItem(item, index)", ->
    it "moves the item to the given index and emits an 'item-moved' event with the item and its new index", ->
      pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C"), new Item("D")])
      [item1, item2, item3, item4] = pane.items
      pane.on 'item-moved', itemMovedHandler = jasmine.createSpy("itemMovedHandler")

      pane.moveItem(item1, 2)


    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.getActiveItem().path = __filename
        pane.getActiveItem().saveAs = jasmine.createSpy("saveAs")
        pane.saveActiveItemAs()
        expect(atom.showSaveDialogSync).toHaveBeenCalledWith(__filename)
        expect(pane.getActiveItem().saveAs).toHaveBeenCalledWith('/selected/path')

    describe "when the current item does not have a saveAs method", ->
      it "does nothing", ->
        expect(pane.getActiveItem().saveAs).toBeUndefined()
        pane.saveActiveItemAs()
        expect(atom.showSaveDialogSync).not.toHaveBeenCalled()

  describe "::itemForUri(uri)", ->
    it "returns the item for which a call to .getUri() returns the given uri", ->
      pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C"), new Item("D")])
      [item1, item2, item3] = pane.getItems()
      item1.uri = "a"
      item2.uri = "b"
      expect(pane.itemForUri("a")).toBe item1
