bluebird75 / luaunit

LuaUnit is a popular unit-testing framework for Lua, with an interface typical of xUnit libraries (Python unittest, Junit, NUnit, ...). It supports several output formats (Text, TAP, JUnit, ...) to be used directly or work with Continuous Integration platforms (Jenkins, Maven, ...).
Other
572 stars 137 forks source link

Add method and test prefix options. #154

Closed obszczymucha closed 1 year ago

obszczymucha commented 1 year ago

This allows specifying the prefix for test and method names, so the tests can be now defined as follows:

function shouldValidateArguments()
...
end

or

function should_validate_arguments()
...
end

If not provided, the behavior is unchanged and it defaults to the current test prefix.

Example:

local runner = lu.LuaUnit.new()
runner:setOutputType( "text" )
os.exit( runner:runSuite( "-t", "should" ) )