forked from github/server
add a test to make sure that elvenhorses require riding 5
This commit is contained in:
parent
138e0dcc40
commit
2e626be090
1 changed files with 28 additions and 0 deletions
|
@ -48,6 +48,34 @@ function setup()
|
||||||
eressea.settings.set("rules.peasants.growth", "1")
|
eressea.settings.set("rules.peasants.growth", "1")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function test_elvenhorse_requires_riding_5()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
region.create(1, 0, "plain")
|
||||||
|
local goal = region.create(2, 0, "plain")
|
||||||
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
u:add_item("elvenhorse", 1)
|
||||||
|
u:set_skill("riding", 5)
|
||||||
|
u:clear_orders()
|
||||||
|
u:add_order("NACH O O")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(goal, u.region)
|
||||||
|
end
|
||||||
|
|
||||||
|
function test_cannot_ride_elvenhorse_without_enough_skill()
|
||||||
|
local r = region.create(0, 0, "plain")
|
||||||
|
local goal = region.create(1, 0, "plain")
|
||||||
|
region.create(2, 0, "plain")
|
||||||
|
local f = faction.create("noreply@eressea.de", "human", "de")
|
||||||
|
local u = unit.create(f, r, 1)
|
||||||
|
u:add_item("elvenhorse", 1)
|
||||||
|
u:set_skill("riding", 4)
|
||||||
|
u:clear_orders()
|
||||||
|
u:add_order("NACH O O")
|
||||||
|
process_orders()
|
||||||
|
assert_equal(goal, u.region)
|
||||||
|
end
|
||||||
|
|
||||||
function test_no_peasant_growth()
|
function test_no_peasant_growth()
|
||||||
local r = region.create(0, 0, "plain")
|
local r = region.create(0, 0, "plain")
|
||||||
r:set_resource("peasant", 2000)
|
r:set_resource("peasant", 2000)
|
||||||
|
|
Loading…
Reference in a new issue