diff options
author | Florian Walch <florian@fwalch.com> | 2015-05-25 09:45:17 +0300 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2015-05-29 20:57:20 +0300 |
commit | 122890463a547f319e706b952e1f3e89eec0e57c (patch) | |
tree | 9fc5cc61e0c3741db6fe920e5a5f1d4836557056 /test/unit/os/fs_spec.lua | |
parent | 412d246be71bd99cb4edde4e6f984b0b0d91bcd9 (diff) | |
download | rneovim-122890463a547f319e706b952e1f3e89eec0e57c.tar.gz rneovim-122890463a547f319e706b952e1f3e89eec0e57c.tar.bz2 rneovim-122890463a547f319e706b952e1f3e89eec0e57c.zip |
tests: Use pending() instead of silently skipping test. #2737
Diffstat (limited to 'test/unit/os/fs_spec.lua')
-rw-r--r-- | test/unit/os/fs_spec.lua | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua index 1158b81a1d..3d5c6bc885 100644 --- a/test/unit/os/fs_spec.lua +++ b/test/unit/os/fs_spec.lua @@ -268,9 +268,11 @@ describe('fs function', function() return eq(gid, lfs.attributes(filename, 'gid')) end) - it('owner of a file may change the group of the file to any group of which that owner is a member', function() - -- Some systems may not have `id` utility. - if (os.execute('id -G > /dev/null 2>&1') == 0) then + -- Some systems may not have `id` utility. + if (os.execute('id -G > /dev/null 2>&1') ~= 0) then + pending('skipped (missing `id` utility)') + else + it('owner of a file may change the group of the file to any group of which that owner is a member', function() local file_gid = lfs.attributes(filename, 'gid') -- Gets ID of any group of which current user is a member except the @@ -288,17 +290,19 @@ describe('fs function', function() eq(0, (os_fchown(filename, -1, new_gid))) eq(new_gid, (lfs.attributes(filename, 'gid'))) end - end - end) + end) + end - it('returns nonzero if process has not enough permissions', function() - -- On Windows `os_fchown` always returns 0 - -- because `uv_fs_chown` is no-op on this platform. - if (ffi.os ~= 'Windows' and ffi.C.geteuid() ~= 0) then + -- On Windows `os_fchown` always returns 0 + -- because `uv_fs_chown` is no-op on this platform. + if (ffi.os == 'Windows' or ffi.C.geteuid() == 0) then + pending('skipped (os_fchown is no-op on Windows)') + else + it('returns nonzero if process has not enough permissions', function() -- chown to root neq(0, os_fchown(filename, 0, 0)) - end - end) + end) + end end) describe('os_file_is_readonly', function() |