mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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>
This commit is contained in:
parent
fb6e931268
commit
e129e2792d
@ -425,19 +425,18 @@ describe('more path function', function()
|
|||||||
return ffi.string(c_file)
|
return ffi.string(c_file)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
before_each(function() lfs.mkdir('CamelCase') end)
|
||||||
|
after_each(function() lfs.rmdir('CamelCase') end)
|
||||||
|
|
||||||
if ffi.os == 'Windows' or ffi.os == 'OSX' then
|
if ffi.os == 'Windows' or ffi.os == 'OSX' then
|
||||||
it('Corrects the case of file names in Mac and Windows', function()
|
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'))
|
||||||
eq('CamelCase', fix_case('cAMELcASE'))
|
eq('CamelCase', fix_case('cAMELcASE'))
|
||||||
lfs.rmdir('CamelCase')
|
|
||||||
end)
|
end)
|
||||||
else
|
else
|
||||||
it('does nothing on Linux', function()
|
it('does nothing on Linux', function()
|
||||||
lfs.mkdir('CamelCase')
|
|
||||||
eq('camelcase', fix_case('camelcase'))
|
eq('camelcase', fix_case('camelcase'))
|
||||||
eq('cAMELcASE', fix_case('cAMELcASE'))
|
eq('cAMELcASE', fix_case('cAMELcASE'))
|
||||||
lfs.mkdir('CamelCase')
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user