Skip to content

Commit

Permalink
Merge pull request #317 from scala-steward/update/zio-2.0.0-RC6
Browse files Browse the repository at this point in the history
Update zio, zio-test, zio-test-sbt to 2.0.0-RC6
  • Loading branch information
vigoo authored May 4, 2022
2 parents 1f3b2e6 + 02d7088 commit 6ada1fa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ lazy val zio2 = Project("clipp-zio-2", file("clipp-zio-2")).settings(commonSetti
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % "2.0.0-RC5",
"dev.zio" %% "zio-test" % "2.0.0-RC5" % Test,
"dev.zio" %% "zio-test-sbt" % "2.0.0-RC5" % Test
"dev.zio" %% "zio" % "2.0.0-RC6",
"dev.zio" %% "zio-test" % "2.0.0-RC6" % Test,
"dev.zio" %% "zio-test-sbt" % "2.0.0-RC6" % Test
),

testFrameworks += new TestFramework("zio.test.sbt.ZTestFramework")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package io.github.vigoo.clipp

import cats.data.NonEmptyList
import io.github.vigoo.clipp.errors.CustomParserError
import zio.{CanFail, Console, IsNotIntersection, Runtime, Tag, URIO, ZIO, ZIOAppArgs, ZLayer}
import zio.{CanFail, Console, Runtime, Tag, URIO, ZIO, ZIOAppArgs, ZLayer}

package object zioapi {
type ClippEnv = Any
Expand Down Expand Up @@ -66,15 +66,15 @@ package object zioapi {
zioapi.liftURIO[R, T](description, example)(f)
}

def parametersFromArgs[T: Tag : IsNotIntersection](spec: Parameter.Spec[T]): ZLayer[ZIOAppArgs, ParserFailure, T] =
def parametersFromArgs[T: Tag](spec: Parameter.Spec[T]): ZLayer[ZIOAppArgs, ParserFailure, T] =
ZLayer {
for {
args <- ZIO.service[ZIOAppArgs]
result <- Clipp.parseOrFail(args.getArgs, spec)
} yield result
}

def effectfulParametersFromArgs[R, T: Tag : IsNotIntersection](createSpec: ZioDSL[R] => Parameter.Spec[T]): ZLayer[ZIOAppArgs with R, ParserFailure, T] =
def effectfulParametersFromArgs[R, T: Tag](createSpec: ZioDSL[R] => Parameter.Spec[T]): ZLayer[ZIOAppArgs with R, ParserFailure, T] =
ZLayer {
for {
runtime <- ZIO.runtime[R]
Expand All @@ -91,5 +91,5 @@ package object zioapi {
}
}

def parameters[T: Tag : IsNotIntersection]: URIO[T, T] = ZIO.service[T]
def parameters[T: Tag]: URIO[T, T] = ZIO.service[T]
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object ZioSpecs extends ZIOSpecDefault {
}
}

assertM(parameters[String].unit.provide(ZLayer.succeed(ZIOAppArgs(Chunk.empty)), config).exit)(fails(
assertZIO(parameters[String].unit.provide(ZLayer.succeed(ZIOAppArgs(Chunk.empty)), config).exit)(fails(
hasField("errors", _.errors.toList, contains[ParserError](CustomError("failure")))))
}
)
Expand Down

0 comments on commit 6ada1fa

Please sign in to comment.