-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #158 from senia-psm/rollback_to_zio_1.0.15
rollback to zio 1.0.15
- Loading branch information
Showing
11 changed files
with
103 additions
and
57 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
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 |
---|---|---|
@@ -1,13 +1,45 @@ | ||
package zio.test.akkahttp | ||
|
||
import zio._ | ||
import zio.test.{Spec, TestEnvironment, ZIOSpec} | ||
import zio.duration._ | ||
import zio.clock.Clock | ||
import zio.test._ | ||
import zio.test.environment.{testEnvironment, TestEnvironment} | ||
|
||
trait AkkaZIOSpecDefault extends ZIOSpec[RouteTestEnvironment.TestEnvironment with TestEnvironment] with RouteTest { | ||
trait AkkaZIOSpecDefault | ||
extends RunnableSpec[RouteTestEnvironment.TestEnvironment with TestEnvironment, Any] | ||
with RouteTest { | ||
|
||
override val bootstrap | ||
: ZLayer[ZIOAppArgs with Scope, Any, RouteTestEnvironment.TestEnvironment with TestEnvironment] = | ||
zio.ZEnv.live >>> TestEnvironment.live >+> RouteTestEnvironment.environment | ||
override def aspects: List[TestAspect[Nothing, TestEnvironment, Nothing, Any]] = | ||
List(TestAspect.timeoutWarning(60.seconds)) | ||
|
||
override def runner: TestRunner[RouteTestEnvironment.TestEnvironment with TestEnvironment, Any] = | ||
TestRunner(TestExecutor.default(testEnvironment >+> RouteTestEnvironment.environment)) | ||
|
||
/** Returns an effect that executes a given spec, producing the results of the execution. | ||
*/ | ||
private[zio] override def runSpec( | ||
spec: ZSpec[Environment, Failure], | ||
): URIO[TestLogger with Clock, ExecutedSpec[Failure]] = | ||
runner.run(aspects.foldLeft(spec)(_ @@ _) @@ TestAspect.fibers) | ||
|
||
/** Builds a suite containing a number of other specs. | ||
*/ | ||
def suite[R, E, T](label: String)(specs: Spec[R, E, T]*): Spec[R, E, T] = zio.test.suite(label)(specs: _*) | ||
|
||
/** Builds an effectual suite containing a number of other specs. | ||
*/ | ||
def suiteM[R, E, T](label: String)(specs: ZIO[R, E, Iterable[Spec[R, E, T]]]): Spec[R, E, T] = | ||
zio.test.suiteM(label)(specs) | ||
|
||
/** Builds a spec with a single pure test. | ||
*/ | ||
def test(label: String)(assertion: => TestResult)(implicit loc: SourceLocation): ZSpec[Any, Nothing] = | ||
zio.test.test(label)(assertion) | ||
|
||
/** Builds a spec with a single effectful test. | ||
*/ | ||
def testM[R, E](label: String)(assertion: => ZIO[R, E, TestResult])(implicit loc: SourceLocation): ZSpec[R, E] = | ||
zio.test.testM(label)(assertion) | ||
|
||
def spec: Spec[RouteTestEnvironment.TestEnvironment with TestEnvironment with Scope, Any] | ||
} |
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
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
Oops, something went wrong.