Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
ZIO 2.0.0-RC4
Browse files Browse the repository at this point in the history
  • Loading branch information
runtologist committed Apr 3, 2022
1 parent 8237ce4 commit f682764
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 20 deletions.
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ Global / onChangedBuildSource := ReloadOnSourceChanges
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")

val zioVersion = "2.0.0-RC3"
val zioVersion = "2.0.0-RC4"
val rsVersion = "1.0.3"
val collCompatVersion = "2.5.0"
val collCompatVersion = "2.7.0"

lazy val interopReactiveStreams = project
.in(file("."))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import zio.stream.Stream
import zio.test.Assertion._
import zio.test._

object PublisherToStreamSpec extends DefaultRunnableSpec {
object PublisherToStreamSpec extends ZIOSpecDefault {

override def spec =
suite("Converting a `Publisher` to a `Stream`")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import zio.stream.{ Sink, ZSink }
import zio.test.Assertion._
import zio.test._

object SinkToSubscriberSpec extends DefaultRunnableSpec {
object SinkToSubscriberSpec extends ZIOSpecDefault {
override def spec =
suite("Converting a `Sink` to a `Subscriber`")(
test("works on the happy path")(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import zio.test._

import java.lang.reflect.InvocationTargetException

object StreamToPublisherSpec extends DefaultRunnableSpec {
object StreamToPublisherSpec extends ZIOSpecDefault {
override def spec =
suite("Converting a `Stream` to a `Publisher`")(
suite("passes all required and optional TCK tests")(tests: _*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import zio.{ IO, UIO, ZIO, durationInt }

import scala.jdk.CollectionConverters._

object SubscriberToSinkSpec extends DefaultRunnableSpec {
object SubscriberToSinkSpec extends ZIOSpecDefault {
override def spec =
suite("Converting a `Subscriber` to a `Sink`")(
test("works on the happy path") {
Expand Down Expand Up @@ -77,20 +77,17 @@ object SubscriberToSinkSpec extends DefaultRunnableSpec {
}
} @@ nonFlaky(10),
test("transports errors only once") {
makeSubscriber.flatMap(probe =>
ZIO.scoped {
probe.underlying
.toSink[Throwable]
.flatMap { case (signalError, sink) =>
for {
_ <- ZStream.fail(e).run(sink).catchAll(signalError)
err <- probe.expectError.exit
_ <- signalError(e)
err2 <- probe.expectError.timeout(100.millis).exit
} yield assert(err)(succeeds(equalTo(e))) && assert(err2)(fails(anything))
}
}
)
ZIO.scoped[Any] {
for {
probe <- makeSubscriber
ses <- probe.underlying.toSink
(signalError, sink) = ses
_ <- ZStream.fail(e).run(sink).catchAll(signalError)
err <- probe.expectError.exit
_ <- signalError(e)
err2 <- probe.expectError.timeout(100.millis).exit
} yield assert(err)(succeeds(equalTo(e))) && assert(err2)(fails(anything))
}
}
)

Expand Down

0 comments on commit f682764

Please sign in to comment.