forked from zio/zio-sql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
44a6e96
commit a29717f
Showing
6 changed files
with
32 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
postgres/src/test/scala/zio/sql/postgresql/DeleteSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package zio.sql.postgresql | ||
|
||
import zio.Cause | ||
import zio.test.Assertion._ | ||
import zio.test._ | ||
|
||
import scala.language.postfixOps | ||
|
||
object DeleteSpec extends PostgresRunnableSpec with ShopSchema { | ||
|
||
import Customers._ | ||
|
||
override def specLayered = suite("Postgres module delete")( | ||
testM("Can delete from single table with a condition") { | ||
val query = deleteFrom(customers) where (verified isNotTrue) | ||
println(renderDelete(query)) | ||
|
||
val result = execute(query) | ||
|
||
val assertion = for { | ||
r <- result | ||
} yield assert(r)(equalTo(1)) | ||
|
||
assertion.mapErrorCause(cause => Cause.stackless(cause.untraced)) | ||
} | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters