   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
+      [item1, item2, item3, item4] = pane.getItems()
       pane.on 'item-moved', itemMovedHandler = jasmine.createSpy("itemMovedHandler")
 
       pane.moveItem(item1, 2)

      pane = new Pane(items: [new Item("A"), new Item("B")])

    it "changes the active item to the current item", ->
      expect(pane.activeItem).toBe pane.items[0]
      pane.activateItem(pane.items[1])
      expect(pane.activeItem).toBe pane.items[1]

    it "adds the given item if it isn't present in ::items", ->
      item = new Item("C")
      pane.activateItem(item)
      expect(item in pane.items).toBe true
      expect(pane.activeItem).toBe item

  describe "::activateNextItem() and ::activatePreviousItem()", ->
    it "sets the active item to the next/previous item, looping around at either end", ->
      pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C")])
      [item1, item2, item3] = pane.items

      expect(pane.activeItem).toBe item1
      pane.activatePreviousItem()
      expect(pane.activeItem).toBe item3
      pane.activatePreviousItem()
      expect(pane.activeItem).toBe item2
      pane.activateNextItem()
      expect(pane.activeItem).toBe item3
      pane.activateNextItem()
      expect(pane.activeItem).toBe item1

  describe "::activateItemAtIndex(index)", ->
    it "activates the item at the given index", ->
      pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C")])
      [item1, item2, item3] = pane.items
      pane.activateItemAtIndex(2)
      expect(pane.activeItem).toBe item3
      pane.activateItemAtIndex(1)
      expect(pane.activeItem).toBe item2
      pane.activateItemAtIndex(0)
      expect(pane.activeItem).toBe item1

      # Doesn't fail with out-of-bounds indices
      pane.activateItemAtIndex(100)
      expect(pane.activeItem).toBe item1
      pane.activateItemAtIndex(-1)
      expect(pane.activeItem).toBe item1

  describe "::destroyItem(item)", ->
    [pane, item1, item2, item3] = []

    beforeEach ->
      pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C")])
      [item1, item2, item3] = pane.items

    it "removes the item from the items list", ->
      expect(pane.activeItem).toBe item1
      pane.destroyItem(item2)
      expect(item2 in pane.items).toBe false
      expect(pane.activeItem).toBe item1

      pane.destroyItem(item1)
      expect(item1 in pane.items).toBe false

    describe "when the destroyed item is the active item and is the first item", ->
      it "activates the next item", ->
        expect(pane.activeItem).toBe item1
        pane.destroyItem(item1)
        expect(pane.activeItem).toBe item2

    describe "when the destroyed item is the active item and is not the first item", ->
      beforeEach ->
        pane.activateItem(item2)

      it "activates the previous item", ->
        expect(pane.activeItem).toBe item2
        pane.destroyItem(item2)
        expect(pane.activeItem).toBe item1

    it "emits 'item-removed' with the item, its index, and true indicating the item is being destroyed", ->
      pane.on 'item-removed', itemRemovedHandler = jasmine.createSpy("itemRemovedHandler")

      pane.$activeItem.changes.onValue -> events.push('active-item-changed')

      pane.addItem(item)
      expect(pane.getActiveItem()).toBe item
      expect(events).toEqual ['item-added', 'active-item-changed']

  describe "::activateItem(item)", ->
