object Live
The Live
trait provides access to the "live" environment from within the
test environment for effects such as printing test results to the console
or timing out tests where it is necessary to access the real environment.
The easiest way to access the "live" environment is to use the live
method with an effect that would otherwise access the test environment.
import zio.clock import zio.test.environment._ val realTime = live(clock.nanoTime)
The withLive
method can be used to apply a transformation to an effect
with the live environment while ensuring that the effect itself still runs
with the test environment, for example to time out a test. Both of these
methods are re-exported in the environment
package for easy availability.
- Alphabetic
- By Inheritance
- Live
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
default: ZLayer[zio.ZEnv, Nothing, Live]
Constructs a new
Live
service that implements theLive
interface.Constructs a new
Live
service that implements theLive
interface. This typically should not be necessary asTestEnvironment
provides access to live versions of all the standard ZIO environment types but could be useful if you are mixing in interfaces to create your own environment type. -
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
live[E, A](zio: ZIO[zio.ZEnv, E, A]): ZIO[Live, E, A]
Provides an effect with the "live" environment.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
withLive[R <: Live, E, E1, A, B](zio: ZIO[R, E, A])(f: (IO[E, A]) ⇒ ZIO[zio.ZEnv, E1, B]): ZIO[R, E1, B]
Provides a transformation function with access to the live environment while ensuring that the effect itself is provided with the test environment.