 
   describe '::onShouldLint', ->
     it 'ignores instant save requests', ->
-      textEditor = atom.workspace.getActiveTextEditor()
-      editorLinter = new EditorLinter(textEditor)
       timesTriggered = 0
       editorLinter.onShouldLint ->
         timesTriggered++

describe 'editor-linter', ->
  EditorLinter = require('../lib/editor-linter')
  beforeEach ->
    waitsForPromise ->
      atom.workspace.destroyActivePaneItem()
      atom.workspace.open('test.txt')

  describe '::constructor', ->
    it "cries when provided argument isn't a TextEditor", ->

      textEditor.save()
      textEditor.save()
      expect(timesTriggered).toBe(5)

  describe '::onDidDestroy', ->
    it 'is called when TextEditor is destroyed', ->
      didDestroy = false
      editorLinter.onDidDestroy ->
        didDestroy = true
      textEditor.destroy()
      expect(didDestroy).toBe(true)
