Skip to content

Commit 13d5d3a

Browse files
committed
Merge pull request #33 from sainaen/fix_sample_specs
Fix core's sample specs
2 parents a34af8d + 69912ff commit 13d5d3a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

core/src/test/scala/sample/MySQLSampleSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ class MySQLSampleSpec extends FlatSpec with Matchers with DBSettings with Loggin
5454
}
5555

5656
it should "read values with convenience methods" in {
57-
val generatedIdFuture: Future[Long] = AsyncDB.withPool { implicit s =>
57+
val generatedIdFuture: Future[Long] = NamedAsyncDB('mysql).withPool { implicit s =>
5858
withSQL {
5959
insert.into(AsyncLover).namedValues(
6060
column.name -> "Eric",
6161
column.rating -> 2,
6262
column.isReactive -> false,
63-
column.createdAt -> createdTime).returningId
63+
column.createdAt -> createdTime)
6464
}.updateAndReturnGeneratedKey.future()
6565
}
6666
// in AsyncLover#apply we are using get with typebinders, specialized getters should work
6767
val generatedId = Await.result(generatedIdFuture, 5.seconds)
68-
val created = DB.readOnly { implicit s =>
68+
val created = NamedDB('mysql).readOnly { implicit s =>
6969
withSQL { select.from(AsyncLover as al).where.eq(al.id, generatedId) }.map((rs: WrappedResultSet) => {
7070
AsyncLover(
7171
id = rs.long(al.resultName.id),
@@ -109,7 +109,7 @@ class MySQLSampleSpec extends FlatSpec with Matchers with DBSettings with Loggin
109109

110110
it should "update" in {
111111
// updating queries should be successful
112-
DB autoCommit { implicit s =>
112+
NamedDB('mysql) autoCommit { implicit s =>
113113
withSQL { delete.from(AsyncLover).where.eq(column.id, 1004) }.update.apply()
114114
withSQL {
115115
insert.into(AsyncLover).namedValues(

core/src/test/scala/sample/PostgreSQLSampleSpec.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package sample
22

33
import org.joda.time._
44
import org.scalatest._
5-
import org.slf4j.LoggerFactory
65
import scala.concurrent._, duration.DurationInt, ExecutionContext.Implicits.global
76
import scalikejdbc._, async._
87
import unit._
@@ -119,7 +118,7 @@ class PostgreSQLSampleSpec extends FlatSpec with Matchers with DBSettings with L
119118
Await.result(deletion, 5.seconds)
120119

121120
// should be committed
122-
val deleted = NamedDB('mysql).readOnly { implicit s =>
121+
val deleted = DB.readOnly { implicit s =>
123122
withSQL { select.from(AsyncLover as al).where.eq(al.id, 1004) }.map(AsyncLover(al)).single.apply()
124123
}
125124
deleted.isDefined should be(false)

project/Build.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object ScalikeJDBCAsyncProject extends Build {
55

66
lazy val _version = "0.6.0-SNAPSHOT"
77
lazy val scalikejdbcVersion = "2.2.9"
8-
lazy val mauricioVersion = "0.2.+" // provided
8+
lazy val mauricioVersion = "0.2.18" // provided
99
lazy val postgresqlVersion = "9.4-1201-jdbc41"
1010
lazy val defaultPlayVersion = play.core.PlayVersion.current
1111

0 commit comments

Comments
 (0)