diff --git a/magnum-zio/src/test/scala/ZioPgTests.scala b/magnum-zio/src/test/scala/ZioPgTests.scala index 73c9d9b..cdb5eb1 100644 --- a/magnum-zio/src/test/scala/ZioPgTests.scala +++ b/magnum-zio/src/test/scala/ZioPgTests.scala @@ -27,7 +27,7 @@ class ZioPgTests extends FunSuite, TestContainersFixtures: def runIO[A](io: ZIO[Any, Throwable, A]): A = Unsafe.unsafe { implicit unsafe => - runtime.unsafe.run(io).getOrThrowFiberFailure() + runtime.unsafe.run(io).getOrThrow() } /* @@ -442,15 +442,24 @@ class ZioPgTests extends FunSuite, TestContainersFixtures: isAdmin = false, socialId = None ) - val count = + val countBefore = runIO: transact(dataSource): - try - personRepo.insert(p) - throw RuntimeException() - fail("should not reach") - catch case _: Exception => personRepo.count - assertEquals(count, 8L) + personRepo.count + try + runIO: + transact(dataSource): + personRepo.insert(p) + throw RuntimeException() + fail("should not reach") + catch + case _: RuntimeException => () + val countAfter = + runIO: + connect(dataSource): + personRepo.count + assertEquals(countBefore, 8L) + assertEquals(countBefore, countAfter) test("custom insert"): val p = PersonCreator(