TestConsole

zio.test.TestConsole$
See theTestConsole companion trait
object TestConsole extends Serializable

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Type members

Classlikes

final case class Data(input: List[String], output: Vector[String], errOutput: Vector[String])

The state of the TestConsole.

The state of the TestConsole.

Attributes

Graph
Supertypes
trait Product
trait Equals
class Object
trait Matchable
class Any
case class Test(consoleState: Atomic[Data], live: Live, annotations: Annotations, debugState: FiberRef[Boolean]) extends TestConsole

Attributes

Graph
Supertypes
trait Product
trait Equals
trait Console
class Object
trait Matchable
class Any

Value members

Concrete methods

def clearInput(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and clears the input buffer.

Accesses a TestConsole instance in the environment and clears the input buffer.

Attributes

def clearOutput(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and clears the output buffer.

Accesses a TestConsole instance in the environment and clears the output buffer.

Attributes

def debug[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to debug mode, so that console output is rendered to standard output in addition to being written to the output buffer.

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to debug mode, so that console output is rendered to standard output in addition to being written to the output buffer.

Attributes

def feedLines(lines: String*)(implicit trace: Trace): UIO[Unit]

Accesses a TestConsole instance in the environment and writes the specified sequence of strings to the input buffer.

Accesses a TestConsole instance in the environment and writes the specified sequence of strings to the input buffer.

Attributes

def make(data: Data, debug: Boolean)(implicit trace: Trace): ZLayer[Live & Annotations, Nothing, TestConsole]

Constructs a new Test object that implements the TestConsole interface. This can be useful for mixing in with implementations of other interfaces.

Constructs a new Test object that implements the TestConsole interface. This can be useful for mixing in with implementations of other interfaces.

Attributes

def output(implicit trace: Trace): UIO[Vector[String]]

Accesses a TestConsole instance in the environment and returns the contents of the output buffer.

Accesses a TestConsole instance in the environment and returns the contents of the output buffer.

Attributes

def outputErr(implicit trace: Trace): UIO[Vector[String]]

Accesses a TestConsole instance in the environment and returns the contents of the error buffer.

Accesses a TestConsole instance in the environment and returns the contents of the error buffer.

Attributes

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

Accesses a TestConsole instance in the environment and saves the console state in an effect which, when run, will restore the TestConsole to the saved state.

Accesses a TestConsole instance in the environment and saves the console state in an effect which, when run, will restore the TestConsole to the saved state.

Attributes

def silent[R, E, A](zio: ZIO[R, E, A])(implicit trace: Trace): ZIO[R, E, A]

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to silent mode, so that console output is only written to the output buffer and not rendered to standard output.

Accesses a TestConsole instance in the environment and runs the specified effect with the TestConsole set to silent mode, so that console output is only written to the output buffer and not rendered to standard output.

Attributes

Concrete fields