Add system base tests with some fixtures

pull/1/merge
Thibault Duplessis 2012-03-01 00:18:27 +01:00
parent bfcebee2bb
commit 231553acff
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package lila.system
import model._
trait Fixtures {
lazy val newGame = Game(
id = "arstdhne",
players = List(white, black),
pgn = "",
status = 10,
turns = 0,
variant = 1
)
lazy val white = player("white", "ip ar jp bn kp cb lp dq mp ek np fb op gn pp hr")
lazy val black = player("black", "Wp 4r Xp 5n Yp 6b Zp 7q 0p 8k 1p 9b 2p !n 3p ?r")
def player(color: String, ps: String) = Player(
id = color take 4,
color = color,
ps = "ip ar jp bn kp cb lp dq mp ek np fb op gn pp hr",
aiLevel = None,
isWinner = None,
evts = Some("0s|1Msystem White creates the game|2Msystem Black joins the game|3r/ipkkf590ldrr"),
elo = Some(1280)
)
}

View File

@ -0,0 +1,10 @@
package lila.system
import org.specs2.mutable.Specification
import ornicar.scalalib.test.OrnicarValidationMatchers
trait SystemTest
extends Specification
with OrnicarValidationMatchers
with Fixtures {
}