From e129e2792da32c667657f2e21a97e65f847a6ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=BCrgin?= <676c7473@gmail.com> Date: Fri, 10 Apr 2015 22:23:01 +0200 Subject: [PATCH] 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 Suggested-by: Scott Prager --- test/unit/path_spec.lua | 7 +++---- 1 file 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)