Combines this spec with the specified spec.
Annotates each test in this spec with the specified test annotation.
Returns a new spec with the annotation map at each node.
Returns the number of tests in the spec that satisfy the specified predicate.
Returns an effect that models execution of this spec.
Determines if any node in the spec is satisfied by the given predicate.
Returns a new spec with only those tests with annotations satisfying the specified predicate.
Returns a new spec with only those tests with annotations satisfying the
specified predicate. If no annotations satisfy the specified predicate then
returns Some with an empty suite if this is a suite or None otherwise.
Returns a new spec with only those suites and tests satisfying the specified predicate.
Returns a new spec with only those suites and tests satisfying the
specified predicate. If a suite label satisfies the predicate the entire
suite will be included in the new spec. Otherwise only those specs in a
suite that satisfy the specified predicate will be included in the new
spec. If no labels satisfy the specified predicate then returns Some with
an empty suite if this is a suite or None otherwise.
Returns a new spec with only those suites and tests with tags satisfying the specified predicate.
Returns a new spec with only those suites and tests with tags satisfying
the specified predicate. If no tags satisfy the specified predicate then
returns Some with an empty suite with the root label if this is a suite
or None otherwise.
Folds over all nodes to produce a final result.
Effectfully folds over all nodes according to the execution strategy of suites, utilizing the specified default for other cases.
Determines if all node in the spec are satisfied by the given predicate.
Iterates over the spec with the sequential strategy as the default, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Iterates over the spec with the specified default execution strategy, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Iterates over the spec with the parallel strategy as the default, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Iterates over the spec with the parallel (n) strategy as the default, and
effectfully transforming every test with the provided function, finally
reconstructing the spec with the same structure.
Automatically assembles a service builder for the spec, translating it up a level.
Automatically assembles a service builder for the spec, translating it up a level.
Automatically constructs the part of the environment that is not part of
the TestEnvironment, leaving an effect that only depends on the
TestEnvironment.
Automatically constructs the part of the environment that is not part of
the TestEnvironment, leaving an effect that only depends on the
TestEnvironment. This will also satisfy transitive TestEnvironment
requirements with TestEnvironment.any, allowing them to be provided
later.
val spec: ZIO[Has[UserRepo] with Has[Console], Nothing, Unit] = ??? val userRepoServiceBuilder: ZServiceBuilder[Has[Database], Nothing, Has[UserRepo] = ??? val databaseServiceBuilder: ZServiceBuilder[Has[Clock], Nothing, Has[Database]] = ??? // The TestEnvironment you use later will provide Clock to // `databaseServiceBuilder` and Console to `spec` val spec2 : ZIO[TestEnvironment, Nothing, Unit] = spec.injectCustom(userRepoServiceBuilder, databaseServiceBuilder)
Automatically constructs the part of the environment that is not part of
the TestEnvironment, leaving an effect that only depends on the
TestEnvironment, sharing services between all tests.
Automatically constructs the part of the environment that is not part of
the TestEnvironment, leaving an effect that only depends on the
TestEnvironment, sharing services between all tests.
This will also satisfy transitive TestEnvironment requirements with
TestEnvironment.any, allowing them to be provided later.
val spec: ZIO[Has[UserRepo] with Has[Console], Nothing, Unit] = ??? val userRepoServiceBuilder: ZServiceBuilder[Has[Database], Nothing, Has[UserRepo] = ??? val databaseServiceBuilder: ZServiceBuilder[Has[Clock], Nothing, Has[Database]] = ??? // The TestEnvironment you use later will provide Clock to // `databaseServiceBuilder` and Console to `spec` val spec2 : ZIO[TestEnvironment, Nothing, Unit] = spec.injectCustomShared(userRepoServiceBuilder, databaseServiceBuilder)
Automatically assembles a service builder for the spec, sharing services between all tests.
Automatically assembles a service builder for the spec, sharing services between all tests.
Splits the environment into two parts, providing each test with one part
using the specified service builder and leaving the remainder R0.
Splits the environment into two parts, providing each test with one part
using the specified service builder and leaving the remainder R0.
val spec: ZSpec[Has[Clock] with Has[Random], Nothing] = ??? val clockServiceBuilder: ZServiceBuilder[Any, Nothing, Has[Clock]] = ??? val spec2: ZSpec[Has[Random], Nothing] = spec.injectSome[Has[Random]](clockServiceBuilder)
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified service builder and leaving the
remainder R0.
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified service builder and leaving the
remainder R0.
val spec: ZSpec[Has[Int] with Has[Random], Nothing] = ??? val intServiceBuilder: ZServiceBuilder[Any, Nothing, Has[Int]] = ??? val spec2 = spec.injectSomeShared[Has[Random]](intServiceBuilder)
Returns a new spec with remapped errors and tests.
Returns a new spec with remapped errors.
Returns a new spec with remapped labels.
Returns a new spec with remapped tests.
Provides each test in this spec with its required environment
Provides each test with the part of the environment that is not part of the
TestEnvironment, leaving a spec that only depends on the
TestEnvironment.
Provides each test with the part of the environment that is not part of the
TestEnvironment, leaving a spec that only depends on the
TestEnvironment.
val loggingServiceBuilder: ZServiceBuilder[Any, Nothing, Logging] = ??? val spec: ZSpec[TestEnvironment with Logging, Nothing] = ??? val spec2 = spec.provideCustomServices(loggingServiceBuilder)
Provides all tests with a shared version of the part of the environment
that is not part of the TestEnvironment, leaving a spec that only depends
on the TestEnvironment.
Provides all tests with a shared version of the part of the environment
that is not part of the TestEnvironment, leaving a spec that only depends
on the TestEnvironment.
val loggingServiceBuilder: ZServiceBuilder[Any, Nothing, Logging] = ??? val spec: ZSpec[TestEnvironment with Logging, Nothing] = ??? val spec2 = spec.provideCustomServicesShared(loggingServiceBuilder)
Provides a service builder to the spec, translating it up a level.
Provides a service builder to the spec, sharing services between all tests.
Uses the specified function to provide each test in this spec with part of its required environment.
Splits the environment into two parts, providing each test with one part
using the specified service builder and leaving the remainder R0.
Splits the environment into two parts, providing each test with one part
using the specified service builder and leaving the remainder R0.
val clockServiceBuilder: ZServiceBuilder[Any, Nothing, Clock] = ??? val spec: ZSpec[Has[Clock] with Has[Random], Nothing] = ??? val spec2 = spec.provideSomeServices[Has[Random]](clockServiceBuilder)
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified service builder and leaving the
remainder R0.
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified service builder and leaving the
remainder R0.
val clockServiceBuilder: ZServiceBuilder[Any, Nothing, Clock] = ??? val spec: ZSpec[Has[Clock] with Has[Random], Nothing] = ??? val spec2 = spec.provideSomeServicesShared[Has[Random]](clockServiceBuilder)
Computes the size of the spec, i.e.
Computes the size of the spec, i.e. the number of tests in the spec.
Transforms the spec one layer at a time.
Transforms the spec statefully, one layer at a time.
Updates a service in the environment of this effect.
Updates a service at the specified key in the environment of this effect.
Runs the spec only if the specified predicate is satisfied.
Runs the spec only if the specified effectual predicate is satisfied.
Returns a new spec with remapped errors and tests.
Returns a new spec with remapped errors and tests.
(Since version 2.0.0) use mapBoth
Effectfully folds over all nodes according to the execution strategy of suites, utilizing the specified default for other cases.
Effectfully folds over all nodes according to the execution strategy of suites, utilizing the specified default for other cases.
(Since version 2.0.0) use foldManaged
Provides each test with the part of the environment that is not part of the
TestEnvironment, leaving a spec that only depends on the
TestEnvironment.
Provides each test with the part of the environment that is not part of the
TestEnvironment, leaving a spec that only depends on the
TestEnvironment.
val loggingLayer: ZServiceBuilder[Any, Nothing, Logging] = ??? val spec: ZSpec[TestEnvironment with Logging, Nothing] = ??? val spec2 = spec.provideCustomLayer(loggingLayer)
(Since version 2.0.0) use provideCustomServices
Provides all tests with a shared version of the part of the environment
that is not part of the TestEnvironment, leaving a spec that only depends
on the TestEnvironment.
Provides all tests with a shared version of the part of the environment
that is not part of the TestEnvironment, leaving a spec that only depends
on the TestEnvironment.
val loggingLayer: ZServiceBuilder[Any, Nothing, Logging] = ??? val spec: ZSpec[TestEnvironment with Logging, Nothing] = ??? val spec2 = spec.provideCustomLayerShared(loggingLayer)
(Since version 2.0.0) use provideCustomServicesShared
Provides a layer to the spec, translating it up a level.
Provides a layer to the spec, translating it up a level.
(Since version 2.0.0) use provideServices
Provides a layer to the spec, sharing services between all tests.
Provides a layer to the spec, sharing services between all tests.
(Since version 2.0.0) use provideServicesShared
Splits the environment into two parts, providing each test with one part
using the specified layer and leaving the remainder R0.
Splits the environment into two parts, providing each test with one part
using the specified layer and leaving the remainder R0.
val clockLayer: ZServiceBuilder[Any, Nothing, Clock] = ??? val spec: ZSpec[Has[Clock] with Has[Random], Nothing] = ??? val spec2 = spec.provideSomeLayer[Has[Random]](clockLayer)
(Since version 2.0.0) use provideSomeServices
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified layer and leaving the remainder
R0.
Splits the environment into two parts, providing all tests with a shared
version of one part using the specified layer and leaving the remainder
R0.
val clockLayer: ZServiceBuilder[Any, Nothing, Clock] = ??? val spec: ZSpec[Has[Clock] with Has[Random], Nothing] = ??? val spec2 = spec.provideSomeLayerShared[Has[Random]](clockLayer)
(Since version 2.0.0) use provideSomeServicesShared
Runs the spec only if the specified effectual predicate is satisfied.
Runs the spec only if the specified effectual predicate is satisfied.
(Since version 2.0.0) use whenZIO
A
Spec[R, E, T]is the backbone of _ZIO Test_. Every spec is either a suite, which contains other specs, or a test of typeT. All specs require an environment of typeRand may potentially fail with an error of typeE.