     waitsForPromise -> atom.packages.activatePackage('table-edit')
 
   describe 'when a csv file is opened', ->
-    [csvDest, projectPath, openSpy, destroySpy] = []
+    [csvDest, projectPath, tableEditor, tableEditorElement, openSpy, destroySpy, savedContent, spy] = []
 
     sleep = (ms) ->
       start = new Date

            expect(tableEditor).toBeDefined()

          describe 'when modified and saved', ->
            spy = null
            beforeEach ->
              spy = jasmine.createSpy('did-save')
              tableEditor.onDidChangeScreenRows(spy)

              tableEditor.addRow ['Bill', 45, 'male']
              tableEditor.addRow ['Bonnie', 42, 'female']

              waitsFor -> spy.callCount > 0

              runs ->
                spy = jasmine.createSpy('did-save')
                tableEditor.onDidSave(spy)

                tableEditor.save()

              waitsFor -> spy.callCount > 0

              waitsFor sleep WRITE_TIMEOUT

            it 'save the new csv content on disk', ->
              content = fs.readFileSync(csvDest)

              expect(String(content)).toEqual("""
              name;age;gender
              Jane;32;female
              John;30;male


    describe 'when the user choose to open a table editor', ->
      describe 'with the default options', ->
        beforeEach ->
          csvEditor.onDidOpen ({editor}) ->
            tableEditor = editor
