【发布时间】:2014-01-18 00:01:17
【问题描述】:
我正在尝试用 lua 编写测试用例。我想在执行测试用例之前进行一些设置,并在执行测试用例之后进行拆解。我将如何在 LUA 中实现。 lua 支持吗?
myFirstLuaTesting.lua
function setUp() #Should be executed first
--setup the testcase
function testSample1() #Should be executed after setup
--execute assertions in test case
function testSample1() #Should be executed after setup
--execute assertions in test case
function tearDown() #Should be executed last after testcases executed
--tearDown the testcase
我正在使用 lunatest 框架来运行测试用例
lunatest.suite("myFirstLuaTesting")
lunatest.run()
【问题讨论】:
-
在自己编写之前,请查看lua-users.org/wiki/UnitTesting
标签: unit-testing testing lua automation