A Spec[R, E] is the backbone of ZIO Test. Every spec is either a suite, which contains other specs, or a test. All specs require an environment of type R and may potentially fail with an error of type E.
Attributes
- Companion
- object
- Source
- Spec.scala
- Graph
-
- Supertypes
- Self type
-
Members list
Value members
Concrete methods
Combines this spec with the specified spec.
Syntax for adding aspects.
Syntax for adding aspects.
test("foo") { assert(42, equalTo(42)) } @@ ignore
Attributes
- Source
- Spec.scala
Annotates each test in this spec with the specified test annotation.
Returns a new spec with the annotation map at each node.
Returns an effect that models execution of this spec.
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 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.
Attributes
- Source
- Spec.scala
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 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.
Attributes
- Source
- Spec.scala
Attributes
- Source
- Spec.scala
Returns a new spec with only those suites and tests except for the ones with tags satisfying the predicate. If all tests or suites have tags that satisfy the specified predicate then returns Some with an empty suite with the root label if this is a suite or None otherwise.
Returns a new spec with only those suites and tests except for the ones with tags satisfying the predicate. If all tests or suites have tags that satisfy the specified predicate then returns Some with an empty suite with the root label if this is a suite or None otherwise.
Attributes
- Source
- Spec.scala
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.
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.
Attributes
- Source
- Spec.scala
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.
Attributes
- Source
- Spec.scala
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 sequential strategy as the default, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Attributes
- Source
- Spec.scala
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 specified default execution strategy, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Attributes
- Source
- Spec.scala
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 strategy as the default, and effectfully transforming every test with the provided function, finally reconstructing the spec with the same structure.
Attributes
- Source
- Spec.scala
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.
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.
Attributes
- Source
- Spec.scala
Returns a new spec with remapped errors.
Returns a new spec with remapped labels.
Provides each test in this spec with its required environment
Provides a layer to the spec, translating it up a level.
Provides a layer to the spec, sharing services between all tests.
Transforms the environment being provided to each test in this spec with the specified function.
Transforms the environment being provided to each test in this spec with the specified function.
Attributes
- Source
- Spec.scala
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: ZLayer[Any, Nothing, Clock] = ???
val spec: Spec[Clock with Random, Nothing] = ???
val spec2 = spec.provideSomeLayer[Random](clockLayer)
Attributes
- Source
- Spec.scala
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: ZLayer[Any, Nothing, Clock] = ???
val spec: Spec[Clock with Random, Nothing] = ???
val spec2 = spec.provideSomeLayerShared[Random](clockLayer)
Attributes
- Source
- Spec.scala
Transforms the spec 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.
Updates a service at the specified key in the environment of this effect.
Attributes
- Source
- Spec.scala
Runs the spec only if the specified predicate is satisfied.
Deprecated methods
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: ZLayer[Any, Nothing, Logging] = ???
val spec: Spec[TestEnvironment with Logging, Nothing] = ???
val spec2 = spec.provideCustomLayer(loggingLayer)
Attributes
- Deprecated
-
[Since version 2.0.2]use provideLayer - Source
- Spec.scala
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: ZLayer[Any, Nothing, Logging] = ???
val spec: Spec[TestEnvironment with Logging, Nothing] = ???
val spec2 = spec.provideCustomLayerShared(loggingLayer)
Attributes
- Deprecated
-
[Since version 2.0.2]use provideLayerShared - Source
- Spec.scala
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Automatically assembles a layer for the spec, translating it up a level.
Automatically assembles a layer for the spec, translating it up a level.
Attributes
- Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
Automatically assembles a layer for the spec, sharing services between all tests.
Automatically assembles a layer for the spec, sharing services between all tests.
Attributes
- Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
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 spec: ZSpec[Clock with Random, Nothing] = ???
val clockLayer: ZLayer[Any, Nothing, Clock] = ???
val spec2: ZSpec[Random, Nothing] = spec.provideSome[Random](clockLayer)
Attributes
- Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
Equivalent to provideSome, but does not require providing the remainder type
Equivalent to provideSome, but does not require providing the remainder type
val spec: ZSpec[Clock with Random, Nothing] = ???
val clockLayer: ZLayer[Any, Nothing, Clock] = ???
val spec2 = spec.provideSome(clockLayer) // Inferred type is ZSpec[Random, Nothing]
Attributes
- Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
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 spec: ZSpec[Int with Random, Nothing] = ???
val intLayer: ZLayer[Any, Nothing, Int] = ???
val spec2 = spec.provideSomeShared[Random](intLayer)
Attributes
- Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
Deprecated and Inherited methods
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.
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 zio: ZIO[OldLady with Console, Nothing, Unit] = ???
val oldLadyLayer: ZLayer[Fly, Nothing, OldLady] = ???
val flyLayer: ZLayer[Blocking, Nothing, Fly] = ???
// The TestEnvironment you use later will provide both Blocking to flyLayer and
// Console to zio
val zio2 : ZIO[TestEnvironment, Nothing, Unit] =
zio.provideCustom(oldLadyLayer, flyLayer)
Attributes
- Deprecated
-
[Since version 2.0.2]use provide - Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala
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 zio: ZIO[OldLady with Console, Nothing, Unit] = ???
val oldLadyLayer: ZLayer[Fly, Nothing, OldLady] = ???
val flyLayer: ZLayer[Blocking, Nothing, Fly] = ???
// The TestEnvironment you use later will provide both Blocking to flyLayer and
// Console to zio
val zio2 : ZIO[TestEnvironment, Nothing, Unit] =
zio.provideCustom(oldLadyLayer, flyLayer)
Attributes
- Deprecated
-
[Since version 2.0.2]use provideShared - Inherited from:
- SpecVersionSpecific (hidden)
- Source
- SpecVersionSpecific.scala