【发布时间】:2020-02-03 18:35:49
【问题描述】:
我想测试以下功能:
def curl(host: String, attempt: Int = 200): ZIO[Loggings with Clock, Throwable, Unit]
如果环境只使用标准 ZIO 环境,例如 Console with Clock,则测试将开箱即用:
testM("curl on valid URL") {
(for {
r <- composer.curl("https://google.com")
} yield
assert(r, isUnit))
}
测试环境由zio-test提供。
那么问题是,如何用我的Loggings 模块扩展TestEnvironment?
【问题讨论】: