             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("""
+              modifyAndSave ->
+                tableEditor.addRow ['Bill', 45, 'male']
+                tableEditor.addRow ['Bonnie', 42, 'female']
+
+            it 'save the new csv content on disk', ->
+              expect(savedContent).toEqual("""
               name;age;gender
               Jane;32;female
               John;30;male

          csvEditor = t
          csvEditorElement = atom.views.getView(csvEditor)

    beforeEach ->
      openFixture('sample.csv')



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