Skip to content

Commit

Permalink
Format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmccombs committed Oct 3, 2023
1 parent 0a8cb15 commit b06e071
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
5 changes: 3 additions & 2 deletions relate/src/test/scala/ParameterizationTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ class ParameterizationTest extends Specification {
"tuple paramater" should {
"use sub-parameter placeholders" in {
class CustomParameter(value: Int) extends SingleParameter {
protected[this] def set(statement: PreparedStatement, i: Int) = implicitly[Parameterizable[Int]].set(statement, i, value)
protected[this] def set(statement: PreparedStatement, i: Int) =
implicitly[Parameterizable[Int]].set(statement, i, value)
override def appendPlaceholders(stringBuilder: StringBuilder) = stringBuilder.append("?::smallint")
}
val querySql = sql"INSERT INTO myTable (foo, bar) VALUES (${(1, new CustomParameter(1))})"
querySql.toString mustEqual("INSERT INTO myTable (foo, bar) VALUES (?,?::smallint)")
querySql.toString mustEqual "INSERT INTO myTable (foo, bar) VALUES (?,?::smallint)"
}
}
}
20 changes: 10 additions & 10 deletions relate/src/test/scala/SqlResultSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class SqlResultSpec extends Specification with Mockito {
"return a list of 3 elements with an explicit parser" in {
val (rs, _, result) = getMocks

rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getLong("id") returns (100L: java.lang.Long)
rs.getString("name") returns "the name"

Expand All @@ -136,8 +136,8 @@ class SqlResultSpec extends Specification with Mockito {
"return a list of 3 elements with an implicit parser" in {
val (rs, _, result) = getMocks

rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getLong("id") returns (100L: java.lang.Long)
rs.getString("name") returns "the name"

Expand All @@ -162,8 +162,8 @@ class SqlResultSpec extends Specification with Mockito {
"return a map of 3 elements with an explicit parser" in {
val (rs, _, result) = getMocks

rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getLong("id") returns 1L thenReturns 2L thenReturns 3L
rs.getString("name") returns "the name"

Expand Down Expand Up @@ -191,8 +191,8 @@ class SqlResultSpec extends Specification with Mockito {
val (rs, _, result) = getMocks
import java.lang.{Long => L}

rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3
rs.next returns true thenReturn true thenReturn true thenReturn false
rs.getLong("id") returns (1: L) thenReturns (2: L) thenReturns (3: L)
rs.getString("name") returns "the name"

Expand All @@ -215,8 +215,8 @@ class SqlResultSpec extends Specification with Mockito {
val (rs, _, result) = getMocks
import java.lang.{Long => L}

rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3 thenReturn 4
rs.next returns true thenReturn true thenReturn true thenReturn true thenReturn false
rs.getRow returns 0 thenReturn 1 thenReturn 2 thenReturn 3 thenReturn 4
rs.next returns true thenReturn true thenReturn true thenReturn true thenReturn false
rs.getString("id") returns "1" thenReturns "2" thenReturns "1" thenReturns "2"
rs.getString("name") returns "one" thenReturns "two" thenReturns "three" thenReturns "four"

Expand Down

0 comments on commit b06e071

Please sign in to comment.