server/scripts/tests/e3/stealth.lua
Enno Rehling 130f6401b7 No christmas trees in E4
- Bugfix for http://bugs.eressea.de/view.php?id=2019
- removing some old tests
2014-08-10 23:07:25 +02:00

36 lines
899 B
Lua

require "lunit"
module("tests.e3.stealth", package.seeall, lunit.testcase)
local f
local u
function setup()
eressea.free_game()
eressea.settings.set("rules.economy.food", "4")
local r = region.create(0,0, "plain")
f = faction.create("stealthy@eressea.de", "human", "de")
u = unit.create(f, r, 1)
f = faction.create("stealth@eressea.de", "human", "de")
end
function test_stealth_faction_on()
u:clear_orders()
u:add_order("TARNEN PARTEI")
eressea.settings.set("rules.stealth.faction", 1)
process_orders()
assert_not_match("Partei", report.report_unit(u, f))
assert_match("anonym", report.report_unit(u, f))
end
function test_stealth_faction_off()
u:clear_orders()
u:add_order("TARNEN PARTEI")
eressea.settings.set("rules.stealth.faction", 0)
process_orders()
assert_match("Partei", report.report_unit(u, f))
assert_not_match("anonym", report.report_unit(u, f))
end