From 452b76358b0597372e948ebdb6621d9a1661d6f7 Mon Sep 17 00:00:00 2001 From: William Gladen Date: Sun, 2 Jun 2019 12:27:54 -0600 Subject: [PATCH 1/2] Allow ROOT to contain hidden directories. --- busted/modules/test_file_loader.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/busted/modules/test_file_loader.lua b/busted/modules/test_file_loader.lua index 6f2e83d8..3a6be09b 100644 --- a/busted/modules/test_file_loader.lua +++ b/busted/modules/test_file_loader.lua @@ -37,9 +37,9 @@ return function(busted, loaders) fileList = tablex.filter(fileList, function(filename) if path.is_windows then - return not filename:find('%\\%.%w+.%w+') + return not filename:find('%\\%.%w+.%w+', #rootFile) else - return not filename:find('/%.%w+.%w+') + return not filename:find('/%.%w+.%w+', #rootFile) end end) else From 72cad533e9266b2ecfaa8f07454a1b246c93d246 Mon Sep 17 00:00:00 2001 From: William Gladen Date: Mon, 3 Jun 2019 08:51:55 -0600 Subject: [PATCH 2/2] Added test case. --- spec/cl_spec.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/cl_spec.lua b/spec/cl_spec.lua index 30e83040..5db71c61 100644 --- a/spec/cl_spec.lua +++ b/spec/cl_spec.lua @@ -767,3 +767,12 @@ describe('Tests execute option', function() assert.is_equal('hello world', result:match('(.-)\n')) end) end) + +describe('Tests root specification', function() + it('allows hidden directories in root path', function() + local success, errcnt, result = executeBusted('spec/.hidden') + assert.is_false(success) + assert.is_equal(1, errcnt) + assert.is_truthy(result:find('should not be executed')) + end) +end)