View Code? Open in Web Editor
NEW
busted-flaky is a busted extension for handling flaky specs, heavily inspired on RSpec::Retry. Using busted-flaky any block can be retried a specified number of times until it succeeds.
License: MIT License
busted-flaky's People
Contributors
Stargazers
Watchers
busted-flaky's Issues
for busted-flaky
to work, busted itself needs the following changes
commit a0e22d312eba710244098271ff3d68ed6fb44f20
Author: eskerda <[email protected] >
Date: Thu Feb 11 09:16:47 2021 +0100
feat(*) allow helpers to extend busted
diff --git a/busted/modules/helper_loader.lua b/busted/modules/helper_loader.lua
index 300eb16..7d2a54b 100644
--- a/busted/modules/helper_loader.lua
+++ b/busted/modules/helper_loader.lua
@@ -8,12 +8,17 @@ return function()
local success, err = pcall(function()
utils.copy_interpreter_args(options.arguments)
_G.arg = options.arguments
+ local fn
if helper:match('%.lua$') then
- dofile(path.normpath(helper))
+ fn = dofile(path.normpath(helper))
elseif hasMoon and helper:match('%.moon$') then
- moonscript.dofile(path.normpath(helper))
+ fn = moonscript.dofile(path.normpath(helper))
else
- require(helper)
+ fn = require(helper)
+ end
+
+ if fn and type(fn) == "function" then
+ fn(busted, helper, options)
end
end)