From cde7e776b1b08696152a75792dcba39ec0f3a8b0 Mon Sep 17 00:00:00 2001 From: Jacob Wang Date: Fri, 31 Jan 2025 21:46:21 +0000 Subject: [PATCH] fix QueryLogSuite --- .../src/test/scala/doobie/util/QueryLogSuite.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/core/src/test/scala/doobie/util/QueryLogSuite.scala b/modules/core/src/test/scala/doobie/util/QueryLogSuite.scala index 03f5aeb99..142bc2e67 100644 --- a/modules/core/src/test/scala/doobie/util/QueryLogSuite.scala +++ b/modules/core/src/test/scala/doobie/util/QueryLogSuite.scala @@ -16,22 +16,22 @@ import doobie.util.update.Update class QueryLogSuite extends munit.CatsEffectSuite with QueryLogSuitePlatform { - val logEventRef: IO[Ref[IO, LogEvent]] = - Ref.of[IO, LogEvent](null) + val logEventRef: Ref[IO, LogEvent] = + Ref.of[IO, LogEvent](null).unsafeRunSync() val xa = Transactor.fromDriverManager[IO]( "org.h2.Driver", "jdbc:h2:mem:queryspec;DB_CLOSE_DELAY=-1", "sa", "", - logHandler = Some(ev => logEventRef.unsafeRunSync().set(ev)) + logHandler = Some(ev => logEventRef.set(ev)) ) def eventForCIO[A](cio: ConnectionIO[A]): IO[LogEvent] = { for { - _ <- logEventRef.flatMap(_.set(null)) + _ <- logEventRef.set(null) _ <- cio.transact(xa).attempt - log <- logEventRef.flatMap(_.get) + log <- logEventRef.get } yield log }