luaunit
luaunit copied to clipboard
Add method prefix and test prefix/suffix options.
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.
Runner example:
local runner = lu.LuaUnit.new()
runner:setOutputType( "text" )
os.exit( runner:runSuite( "-t", "should" ) )
Or we can do this with objects:
MySpecification = {}
function MySpecification:shouldAddTwoNumbers()
...
end
Runner example:
local runner = lu.LuaUnit.new()
runner:setOutputType( "text" )
os.exit( runner:runSuite( "-T", "Specification", "-m", "should" ) )
Hi,
Sorry for the delay, I just moved to a new house so things like open source have been left behind.
I like the patch, I need to further review it but it looks great. And with unit-tests, this is exceptional 👍
Hey. No worries at all! Thanks for responding!