     describe "when line decorations are attached to markers", ->
       {marker, decoration} = {}
 
-      lineHasClass = (screenRow, klass) ->
-        component.lineNodeForScreenRow(screenRow).classList.contains(klass)
-
       beforeEach ->
         marker = editor.displayBuffer.markBufferRange([[2, 13], [3, 15]], invalidate: 'inside')
         decoration = {type: 'line', class: 'someclass'}

          runSetImmediateCallbacks()
          expect(lineNumberHasClass(1, 'folded')).toBe false

    describe "cursor-line decorations", ->
      cursor = null
      beforeEach ->
        cursor = editor.getCursor()

      it "modifies the cursor-line decoration when the cursor moves", ->
        cursor.setScreenPosition([0, 0])
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(0, 'cursor-line')).toBe true

        cursor.setScreenPosition([1, 0])
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(0, 'cursor-line')).toBe false
        expect(lineNumberHasClass(1, 'cursor-line')).toBe true

      it "updates cursor-line decorations for multiple cursors", ->
        cursor.setScreenPosition([2, 0])
        cursor2 = editor.addCursorAtScreenPosition([8, 0])
        cursor3 = editor.addCursorAtScreenPosition([10, 0])
        runSetImmediateCallbacks()

        expect(lineNumberHasClass(2, 'cursor-line')).toBe true
        expect(lineNumberHasClass(8, 'cursor-line')).toBe true
        expect(lineNumberHasClass(10, 'cursor-line')).toBe true

        cursor2.destroy()
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(2, 'cursor-line')).toBe true
        expect(lineNumberHasClass(8, 'cursor-line')).toBe false
        expect(lineNumberHasClass(10, 'cursor-line')).toBe true

        cursor3.destroy()
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(2, 'cursor-line')).toBe true
        expect(lineNumberHasClass(8, 'cursor-line')).toBe false
        expect(lineNumberHasClass(10, 'cursor-line')).toBe false

      it "adds cursor-line decorations to multiple lines when a selection is performed", ->
        cursor.setScreenPosition([1, 5])
        editor.selectDown(2)
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(0, 'cursor-line')).toBe false
        expect(lineNumberHasClass(1, 'cursor-line')).toBe true
        expect(lineNumberHasClass(2, 'cursor-line')).toBe true
        expect(lineNumberHasClass(3, 'cursor-line')).toBe true
        expect(lineNumberHasClass(4, 'cursor-line')).toBe false

      it "does not render a cursor-line decoration for the last line of a multi-line selection of the selection ends at column 0", ->
        cursor.setScreenPosition([1, 0])
        editor.selectDown(2)
        runSetImmediateCallbacks()
        expect(lineNumberHasClass(0, 'cursor-line')).toBe false
        expect(lineNumberHasClass(1, 'cursor-line')).toBe true
        expect(lineNumberHasClass(2, 'cursor-line')).toBe true
        expect(lineNumberHasClass(3, 'cursor-line')).toBe false

    describe "when gutter decorations are attached to markers", ->
      {marker, decoration} = {}
      beforeEach ->

    clientX = gutterClientRect.left + positionOffset.left - editor.getScrollLeft()
    clientY = gutterClientRect.top + positionOffset.top - editor.getScrollTop()
    {clientX, clientY}

  lineNumberHasClass = (screenRow, klass) ->
    component.lineNumberNodeForScreenRow(screenRow).classList.contains(klass)

  lineNumberForBufferRowHasClass = (bufferRow, klass) ->
    screenRow = editor.displayBuffer.screenRowForBufferRow(bufferRow)
    component.lineNumberNodeForScreenRow(screenRow).classList.contains(klass)

  lineHasClass = (screenRow, klass) ->
    component.lineNodeForScreenRow(screenRow).classList.contains(klass)
