aboutsummaryrefslogtreecommitdiff
path: root/test/unit/path_spec.lua
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-04-10 22:23:01 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-04-12 16:11:50 -0400
commite129e2792da32c667657f2e21a97e65f847a6ed7 (patch)
tree74ed4cb27b5eadf74368629c34c1d378902faa22 /test/unit/path_spec.lua
parentfb6e9312684b0f1bd60822d7da04ba6901b1e48b (diff)
downloadrneovim-e129e2792da32c667657f2e21a97e65f847a6ed7.tar.gz
rneovim-e129e2792da32c667657f2e21a97e65f847a6ed7.tar.bz2
rneovim-e129e2792da32c667657f2e21a97e65f847a6ed7.zip
tests: Fix test setup/teardown in path_spec.lua #2402
A call to lfs.mkdir instead of lfs.rmdir left a temp directory hanging around. Changed to do proper setup/teardown using {before,after}_each. Helped-by: Scott Prager <splinterofchaos@gmail.com> Suggested-by: Scott Prager <splinterofchaos@gmail.com>
Diffstat (limited to 'test/unit/path_spec.lua')
-rw-r--r--test/unit/path_spec.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/unit/path_spec.lua b/test/unit/path_spec.lua
index 13546a6183..261d797624 100644
--- a/test/unit/path_spec.lua
+++ b/test/unit/path_spec.lua
@@ -425,19 +425,18 @@ describe('more path function', function()
return ffi.string(c_file)
end
+ before_each(function() lfs.mkdir('CamelCase') end)
+ after_each(function() lfs.rmdir('CamelCase') end)
+
if ffi.os == 'Windows' or ffi.os == 'OSX' then
it('Corrects the case of file names in Mac and Windows', function()
- lfs.mkdir('CamelCase')
eq('CamelCase', fix_case('camelcase'))
eq('CamelCase', fix_case('cAMELcASE'))
- lfs.rmdir('CamelCase')
end)
else
it('does nothing on Linux', function()
- lfs.mkdir('CamelCase')
eq('camelcase', fix_case('camelcase'))
eq('cAMELcASE', fix_case('cAMELcASE'))
- lfs.mkdir('CamelCase')
end)
end
end)