Fix test case.

This commit is contained in:
takezoe
2013-11-03 15:12:01 +09:00
parent a0bd969140
commit 3dec2b8159
3 changed files with 4 additions and 4 deletions

View File

@@ -147,4 +147,4 @@ trait AccountService {
}
//object AccountService extends AccountService
object AccountService extends AccountService

View File

@@ -9,7 +9,7 @@ class AccountServiceServiceSpec extends Specification with ServiceSpecBase {
val RootMailAddress = "root@localhost"
"getAllUsers" in { withTestDB{
AccountService.getAllUsers must be like{
AccountService.getAllUsers() must be like{
case List(model.Account("root", "root", RootMailAddress, _, true, _, _, _, None, None, false, false)) => ok
}
}}
@@ -75,3 +75,4 @@ class AccountServiceServiceSpec extends Specification with ServiceSpecBase {
}}
}
}

View File

@@ -10,8 +10,7 @@ import java.io.File
trait ServiceSpecBase {
def withTestDB[A](action: => A): A = {
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){
dir =>
util.FileUtil.withTmpDir(new File(FileUtils.getTempDirectory(), Random.alphanumeric.take(10).mkString)){ dir =>
val (url, user, pass) = (s"jdbc:h2:${dir}", "sa", "sa")
org.h2.Driver.load()
using(DriverManager.getConnection(url, user, pass)){ conn =>