diff options
author | starkos <none@none> | 2009-07-16 18:29:08 +0400 |
---|---|---|
committer | starkos <none@none> | 2009-07-16 18:29:08 +0400 |
commit | a0c7b44d2b12fefb4342ef841a9d222b33ba927d (patch) | |
tree | f1619574f2d92391e4ab824416176c530d48af05 /tests/base | |
parent | e5e1e0bdc4a3664fc645a9f63a7c12f64594d191 (diff) |
Started refactoring action list
Diffstat (limited to 'tests/base')
-rw-r--r-- | tests/base/test_action.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/base/test_action.lua b/tests/base/test_action.lua new file mode 100644 index 0000000..ec18b10 --- /dev/null +++ b/tests/base/test_action.lua @@ -0,0 +1,44 @@ +-- +-- tests/base/test_action.lua +-- Automated test suite for the action list. +-- Copyright (c) 2009 Jason Perkins and the Premake project +-- + + T.action = { } + + +-- +-- Setup/teardown +-- + + local fake = { + trigger = "fake", + description = "Fake action used for testing", + } + + function T.action.setup() + premake.actions["fake"] = fake + end + + function T.action.teardown() + premake.actions["fake"] = nil + end + + + +-- +-- Tests +-- + + function T.action.ExecuteIsCalledIfPresent() + local called = false + fake.execute = function () called = true end + premake.action.call("fake") + test.istrue(called) + end + + function T.action.ExecuteIsSkippedIfNotPresent() + test.success(premake.action.call, "fake") + end + + |