Add resource exception

This commit is contained in:
Anton Vakhrushev
2019-10-03 17:10:13 +03:00
parent 6404a6e519
commit 446b1659de
4 changed files with 28 additions and 3 deletions

View File

@ -10,4 +10,13 @@ describe "World" do
world.run(100)
world.map.get(point).has_role(TileRole::CrystalHarvester)
end
it "should fail when not enought resources" do
world = World.new
point = Point.new(2, 3)
cmd = BuildCrystalRestorerCommand.new(point)
expect_raises(NotEnoughtResources) do
world.push(cmd)
end
end
end