From 6881fcd203a0df156557934caf532cc9baa6aa93 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 15 May 2016 21:54:13 +0300 Subject: [PATCH] functests: Do not use setup/teardown where before_/after_each is needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When skipping these test blocks they may error out: Error → test/functional/shell/viml_system_spec.lua @ 154 system() with output containing NULs setup ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value) stack traceback: ./test/functional/helpers.lua:75: in function 'request' ./test/functional/helpers.lua:166: in function 'nvim_feed' ./test/functional/helpers.lua:195: in function 'feed' test/functional/shell/viml_system_spec.lua:14: in function Error → test/functional/shell/viml_system_spec.lua @ 155 system() with output containing NULs teardown ./test/functional/helpers.lua:75: attempt to index upvalue 'session' (a nil value) stack traceback: ./test/functional/helpers.lua:75: in function 'eval' test/functional/shell/viml_system_spec.lua:21: in function --- test/functional/shell/viml_system_spec.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 00b794d25e..3de022cbd9 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -151,8 +151,8 @@ describe('system()', function() describe('with output containing NULs', function() local fname = 'Xtest' - setup(create_file_with_nuls(fname)) - teardown(delete_file(fname)) + before_each(create_file_with_nuls(fname)) + after_each(delete_file(fname)) it('replaces NULs by SOH characters', function() eq('part1\001part2\001part3\n', eval('system("cat '..fname..'")')) @@ -310,8 +310,8 @@ describe('systemlist()', function() describe('with output containing NULs', function() local fname = 'Xtest' - setup(create_file_with_nuls(fname)) - teardown(delete_file(fname)) + before_each(create_file_with_nuls(fname)) + after_each(delete_file(fname)) it('replaces NULs by newline characters', function() eq({'part1\npart2\npart3'}, eval('systemlist("cat '..fname..'")'))