diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-03-12 10:52:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-12 10:52:13 +0100 |
commit | c8f0f8fea6e3170db0d68d61dd84f3c3ef9ee77c (patch) | |
tree | d993945c472a610a265baa79d714c6d32f149f14 /test/unit/os/users_spec.lua | |
parent | b2b15e6e137d7be2b01bf2174791f36bd12981bd (diff) | |
parent | 48e7a83447c0a1a59a110b5ca9e712f560fd9e03 (diff) | |
download | rneovim-c8f0f8fea6e3170db0d68d61dd84f3c3ef9ee77c.tar.gz rneovim-c8f0f8fea6e3170db0d68d61dd84f3c3ef9ee77c.tar.bz2 rneovim-c8f0f8fea6e3170db0d68d61dd84f3c3ef9ee77c.zip |
Merge #6214 from ZyX-I/split-eval'/isolated-unittests
Run all unit tests in separate processes
Diffstat (limited to 'test/unit/os/users_spec.lua')
-rw-r--r-- | test/unit/os/users_spec.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/unit/os/users_spec.lua b/test/unit/os/users_spec.lua index 236481e9e7..f92413c7de 100644 --- a/test/unit/os/users_spec.lua +++ b/test/unit/os/users_spec.lua @@ -1,4 +1,5 @@ -local helpers = require('test.unit.helpers') +local helpers = require('test.unit.helpers')(after_each) +local itp = helpers.gen_itp(it) local cimport = helpers.cimport local eq = helpers.eq @@ -27,11 +28,11 @@ describe('users function', function() local current_username = os.getenv('USER') describe('os_get_usernames', function() - it('returns FAIL if called with NULL', function() + itp('returns FAIL if called with NULL', function() eq(FAIL, users.os_get_usernames(NULL)) end) - it('fills the names garray with os usernames and returns OK', function() + itp('fills the names garray with os usernames and returns OK', function() local ga_users = garray_new() eq(OK, users.os_get_usernames(ga_users)) local user_count = garray_get_len(ga_users) @@ -48,7 +49,7 @@ describe('users function', function() end) describe('os_get_user_name', function() - it('should write the username into the buffer and return OK', function() + itp('should write the username into the buffer and return OK', function() local name_out = ffi.new('char[100]') eq(OK, users.os_get_user_name(name_out, 100)) eq(current_username, ffi.string(name_out)) @@ -56,14 +57,14 @@ describe('users function', function() end) describe('os_get_uname', function() - it('should write the username into the buffer and return OK', function() + itp('should write the username into the buffer and return OK', function() local name_out = ffi.new('char[100]') local user_id = lib.getuid() eq(OK, users.os_get_uname(user_id, name_out, 100)) eq(current_username, ffi.string(name_out)) end) - it('should FAIL if the userid is not found', function() + itp('should FAIL if the userid is not found', function() local name_out = ffi.new('char[100]') -- hoping nobody has this uid local user_id = 2342 @@ -73,16 +74,16 @@ describe('users function', function() end) describe('os_get_user_directory', function() - it('should return NULL if called with NULL', function() + itp('should return NULL if called with NULL', function() eq(NULL, users.os_get_user_directory(NULL)) end) - it('should return $HOME for the current user', function() + itp('should return $HOME for the current user', function() local home = os.getenv('HOME') eq(home, ffi.string((users.os_get_user_directory(current_username)))) end) - it('should return NULL if the user is not found', function() + itp('should return NULL if the user is not found', function() eq(NULL, users.os_get_user_directory('neovim_user_not_found_test')) end) end) |