TestSystem

zio.test.TestSystem
See theTestSystem companion object
trait TestSystem extends System with 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
Graph
Supertypes
trait System
class Object
trait Matchable
class Any
Known subtypes
class Test

Members list

Concise view

Type members

Inherited classlikes

trait UnsafeAPI

Attributes

Inherited from:
System
Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Abstract methods

def clearEnv(variable: String)(implicit trace: Trace): UIO[Unit]
def clearProperty(prop: String)(implicit trace: Trace): UIO[Unit]
def putEnv(name: String, value: String)(implicit trace: Trace): UIO[Unit]
def putProperty(name: String, value: String)(implicit trace: Trace): UIO[Unit]
def setLineSeparator(lineSep: String)(implicit trace: Trace): UIO[Unit]

Inherited methods

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

Inherited from:
System

Attributes

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

Attributes

Inherited from:
Restorable

Attributes

Inherited from:
System