diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-11 16:02:47 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-11 23:23:49 +0300 |
commit | e2a578f40dbd4836330402a44844c7ef8a0df5c5 (patch) | |
tree | ab2b04b6d0228e7d5a4ef6d611971f063a17be17 /test/unit/os/fs_spec.lua | |
parent | 9400466282918396c814ef456d0f65dca51b8889 (diff) | |
download | rneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.tar.gz rneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.tar.bz2 rneovim-e2a578f40dbd4836330402a44844c7ef8a0df5c5.zip |
unittests: Do not import libnvim or headers in main process
Slows down unit tests much, but gets rid of as much preserved state as possible.
Diffstat (limited to 'test/unit/os/fs_spec.lua')
-rw-r--r-- | test/unit/os/fs_spec.lua | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 1ef7d756dc..860ebfdbcb 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -16,10 +16,10 @@ local to_cstr = helpers.to_cstr local OK = helpers.OK local FAIL = helpers.FAIL local NULL = helpers.NULL + local NODE_NORMAL = 0 local NODE_WRITABLE = 1 -cimport('unistd.h') cimport('./src/nvim/os/shell.h') cimport('./src/nvim/option_defs.h') cimport('./src/nvim/main.h') @@ -66,13 +66,10 @@ local function os_getperm(filename) end describe('fs function', function() - local orig_test_file_perm - - setup(function() + before_each(function() lfs.mkdir('unit-test-directory'); io.open('unit-test-directory/test.file', 'w').close() - orig_test_file_perm = os_getperm('unit-test-directory/test.file') io.open('unit-test-directory/test_2.file', 'w').close() lfs.link('test.file', 'unit-test-directory/test_link.file', true) @@ -84,7 +81,7 @@ describe('fs function', function() directory, executable_name = string.match(absolute_executable, '^(.*)/(.*)$') end) - teardown(function() + after_each(function() os.remove('unit-test-directory/test.file') os.remove('unit-test-directory/test_2.file') os.remove('unit-test-directory/test_link.file') @@ -217,10 +214,6 @@ describe('fs function', function() end) describe('file permissions', function() - before_each(function() - os_setperm('unit-test-directory/test.file', orig_test_file_perm) - end) - local function os_fchown(filename, user_id, group_id) local fd = ffi.C.open(filename, 0) local res = fs.os_fchown(fd, user_id, group_id) |