ZIOSpec

zio.test.ZIOSpec
abstract class ZIOSpec[R] extends ZIOSpecAbstract

Attributes

Source
ZIOSpec.scala
Graph
Supertypes
trait ZIOApp
class Object
trait Matchable
class Any
Known subtypes
Self type
ZIOSpec[R]

Members list

Type members

Types

type Environment = R

The services that bootstrap builds and that run can use, besides ZIOAppArgs and Scope.

The services that bootstrap builds and that run can use, besides ZIOAppArgs and Scope.

Attributes

Source
ZIOSpec.scala

Value members

Concrete methods

def suite[In](label: String)(specs: In*)(implicit suiteConstructor: SuiteConstructor[In], sourceLocation: SourceLocation, trace: Trace): Spec[suiteConstructor.OutEnvironment, suiteConstructor.OutError]

Attributes

Source
ZIOSpec.scala
def test[In](label: String)(assertion: => In)(implicit testConstructor: TestConstructor[Nothing, In], sourceLocation: SourceLocation, trace: Trace): testConstructor.Out

Builds a spec with a single test.

Builds a spec with a single test.

Attributes

Source
ZIOSpec.scala

Inherited methods

final def <>(that: ZIOSpecAbstract)(implicit trace: Trace): ZIOSpecAbstract

Attributes

Inherited from:
ZIOSpecAbstract
Source
ZIOSpecAbstract.scala
final def <>(that: ZIOApp)(implicit trace: Trace): ZIOApp

Composes this ZIOApp with another ZIOApp, to yield an application that executes the logic of both applications. The two run effects run in parallel, so when one fails the other is interrupted, and the app's bootstrap combines both bootstrap layers.

Composes this ZIOApp with another ZIOApp, to yield an application that executes the logic of both applications. The two run effects run in parallel, so when one fails the other is interrupted, and the app's bootstrap combines both bootstrap layers.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala
final def exit(code: ExitCode)(implicit trace: Trace): UIO[Unit]

A helper function to exit the application with the specified exit code.

A helper function to exit the application with the specified exit code.

On the JVM and Scala Native it calls System.exit at once, so the finalizers of run do not run; it does nothing when the app is already exiting, and on the JVM it does nothing inside an unforked sbt run. On Scala.js it sets process.exitCode and does not stop the program.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala
final def getArgs(implicit trace: Trace): ZIO[ZIOAppArgs, Nothing, Chunk[String]]

A helper function to obtain access to the command-line arguments of the application. You may use this helper function inside your run function.

A helper function to obtain access to the command-line arguments of the application. You may use this helper function inside your run function.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala

The time that the application waits, after a shutdown signal such as SIGINT interrupts run, for the finalizers to finish before the process exits. The default, Duration.Infinity, waits until they finish, and a zero or negative duration does not wait. When the time runs out, the app prints a warning and the process exits.

The time that the application waits, after a shutdown signal such as SIGINT interrupts run, for the finalizers to finish before the process exits. The default, Duration.Infinity, waits until they finish, and a zero or negative duration does not wait. When the time runs out, the app prints a warning and the process exits.

It is used on the JVM only: on Scala.js and Scala Native the app installs no shutdown hook, so this value has no effect.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala
final def invoke(args: Chunk[String])(implicit trace: Trace): ZIO[Any, Any, Any]

Invokes the main app. Designed primarily for testing.

Invokes the main app. Designed primarily for testing.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala
final def main(args0: Array[String]): Unit

The Scala main function, intended to be called only by the Scala runtime.

The Scala main function, intended to be called only by the Scala runtime.

Attributes

Inherited from:
ZIOAppPlatformSpecific (hidden)
Source
ZIOAppPlatformSpecific.scala
final def run: ZIO[Environment & ZIOAppArgs & Scope, Any, Summary]

The main function of the application, which can access the command-line arguments through the getArgs helper method of this class. If the provided effect fails for any reason, the cause will be logged, and the exit code of the application will be non-zero (1). Otherwise, the exit code of the application will be zero, whatever value the effect succeeds with, even an ExitCode; call exit to end with another code. An interruption that comes from the app shutting down is not logged.

The main function of the application, which can access the command-line arguments through the getArgs helper method of this class. If the provided effect fails for any reason, the cause will be logged, and the exit code of the application will be non-zero (1). Otherwise, the exit code of the application will be zero, whatever value the effect succeeds with, even an ExitCode; call exit to end with another code. An interruption that comes from the app shutting down is not logged.

Attributes

Inherited from:
ZIOSpecAbstract
Source
ZIOSpecAbstract.scala
final protected def runSpec(implicit trace: Trace): ZIO[Environment & TestEnvironment & ZIOAppArgs & Scope, Throwable, Summary]

Attributes

Inherited from:
ZIOSpecAbstract
Source
ZIOSpecAbstract.scala
def runtime: Runtime[Any]

The runtime that main runs the app on: Runtime.default unless overridden. bootstrap can change its settings further.

The runtime that main runs the app on: Runtime.default unless overridden. bootstrap can change its settings further.

Attributes

Inherited from:
ZIOApp
Source
ZIOApp.scala
transparent inline def suiteAll(inline name: String)(inline spec: Any): Any

Attributes

Inherited from:
ZIOSpecVersionSpecific (hidden)
Source
ZIOSpecVersionSpecific.scala

Inherited and Abstract methods

def bootstrap: ZLayer[Any, Any, Environment]

A layer that manages the acquisition and release of services necessary for the application to run.

A layer that manages the acquisition and release of services necessary for the application to run.

Attributes

Inherited from:
ZIOSpecAbstract
Source
ZIOSpecAbstract.scala

Attributes

Inherited from:
ZIOSpecAbstract
Source
ZIOSpecAbstract.scala

Concrete fields

final val environmentTag: Tag[R]

The tag of Environment, which ZIO uses to build the app's environment.

The tag of Environment, which ZIO uses to build the app's environment.

Attributes

Source
ZIOSpec.scala

Implicits

Inherited implicits

implicit inline def validateEnv[R1, R, E, A](inline spec: Spec[R, E]): Spec[R1, E]

This implicit conversion macro will ensure that the provided ZIO effect does not require more than the provided environment.

This implicit conversion macro will ensure that the provided ZIO effect does not require more than the provided environment.

If it is missing requirements, it will report a descriptive error message. Otherwise, the effect will be returned unmodified.

Attributes

Inherited from:
ZIOSpecAbstractVersionSpecific (hidden)
Source
ZIOSpecAbstractVersionSpecific.scala
implicit inline def validateEnv[R1, R, E, A](inline zio: ZIO[R, E, A]): ZIO[R1, E, A]

This implicit conversion macro will ensure that the provided ZIO effect does not require more than the provided environment.

This implicit conversion macro will ensure that the provided ZIO effect does not require more than the provided environment.

If it is missing requirements, it will report a descriptive error message. Otherwise, the effect will be returned unmodified.

Attributes

Inherited from:
ZIOAppVersionSpecific (hidden)
Source
ZIOAppVersionSpecific.scala