import org.specs2.mutable._
import scalikejdbc.specs2.mutable.AutoRollback
trait DB2AutoRollback extends AutoRollback {
overridedef db = NamedDB('db2).toDB
}
object MemberSpec extends Specification {
"Member should create a new record" in new AutoRollback {
Member.create(1, "Alice")
Member.find(1).isDefined must beTrue
}
"LegacyAccount should create a new record" in new DB2AutoRollback {
LegacyAccount.create(2, "Bob")
LegacyAccount.find(2).isDefined must beTrue
}
}
Automatic Rollback support for mutable specs2.
If you want to test this
Member
object,Use scalikejdbc.specs2.mutable.AutoRollback like this: