diff --git a/core/scripts/tests/common.lua b/core/scripts/tests/common.lua index cbc529d14..c79f5bd09 100755 --- a/core/scripts/tests/common.lua +++ b/core/scripts/tests/common.lua @@ -48,6 +48,34 @@ function setup() eressea.settings.set("rules.peasants.growth", "1") 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() local r = region.create(0, 0, "plain") r:set_resource("peasant", 2000)