TestSystem

zio.test.TestSystem
See theTestSystem companion object
trait TestSystem extends System, Restorable

TestSystem supports deterministic testing of effects involving system properties. Internally, TestSystem maintains mappings of environment variables and system properties that can be set and accessed. No actual environment variables or system properties will be accessed or set as a result of these actions.

import zio.system
import zio.test.TestSystem

for {
 _      <- TestSystem.putProperty("java.vm.name", "VM")
 result <- system.property("java.vm.name")
} yield result == Some("VM")

Attributes

Companion
object
Source
TestSystem.scala
Graph
Supertypes
trait Restorable
trait System
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
class Test

Members list

Type members

Inherited classlikes

trait UnsafeAPI extends Serializable

Attributes

Inherited from:
System
Source
System.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any

Value members

Abstract methods

def clearEnv(variable: String)(implicit trace: Trace): UIO[Unit]

Attributes

Source
TestSystem.scala
def clearProperty(prop: String)(implicit trace: Trace): UIO[Unit]

Attributes

Source
TestSystem.scala
def putEnv(name: String, value: String)(implicit trace: Trace): UIO[Unit]

Attributes

Source
TestSystem.scala
def putProperty(name: String, value: String)(implicit trace: Trace): UIO[Unit]

Attributes

Source
TestSystem.scala
def setLineSeparator(lineSep: String)(implicit trace: Trace): UIO[Unit]

Attributes

Source
TestSystem.scala

Inherited methods

Attributes

Inherited from:
System
Source
System.scala

Inherited and Abstract methods

def env(variable: => String)(implicit trace: Trace): IO[SecurityException, Option[String]]

Attributes

Inherited from:
System
Source
System.scala
def envOrElse(variable: => String, alt: => String)(implicit trace: Trace): IO[SecurityException, String]

Attributes

Inherited from:
System
Source
System.scala
def envOrOption(variable: => String, alt: => Option[String])(implicit trace: Trace): IO[SecurityException, Option[String]]

Attributes

Inherited from:
System
Source
System.scala
def envs(implicit trace: Trace): IO[SecurityException, Map[String, String]]

Attributes

Inherited from:
System
Source
System.scala
def lineSeparator(implicit trace: Trace): UIO[String]

Attributes

Inherited from:
System
Source
System.scala
def properties(implicit trace: Trace): IO[Throwable, Map[String, String]]

Attributes

Inherited from:
System
Source
System.scala
def property(prop: => String)(implicit trace: Trace): IO[Throwable, Option[String]]

Attributes

Inherited from:
System
Source
System.scala
def propertyOrElse(prop: => String, alt: => String)(implicit trace: Trace): IO[Throwable, String]

Attributes

Inherited from:
System
Source
System.scala
def propertyOrOption(prop: => String, alt: => Option[String])(implicit trace: Trace): IO[Throwable, Option[String]]

Attributes

Inherited from:
System
Source
System.scala
def save(implicit trace: Trace): UIO[UIO[Unit]]

Attributes

Inherited from:
Restorable
Source
Restorable.scala