Skip to content

Commit

Permalink
Re-enable edsl & examples
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Jan 5, 2025
1 parent 676f217 commit d97d5e9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions backend/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ lazy val `mockingbird-native` = (project in file("mockingbird-native"))
)
)

/*
val edsl = (project in file("edsl"))
.dependsOn(utils, circeUtils)
.settings(Settings.common)
Expand All @@ -169,7 +168,9 @@ val edsl = (project in file("edsl"))
).flatten,
libraryDependencies ++= Seq(
"com.softwaremill.sttp.client4" %% "circe" % Versions.sttp,
"pl.muninn" %% "scala-md-tag" % "0.2.3",
"pl.muninn" %% "scala-md-tag" % "0.2.3" cross CrossVersion.for3Use2_13 excludeAll(
ExclusionRule("org.scala-lang.modules", "scala-collection-compat_2.13")
),
),
)
.settings(
Expand Down Expand Up @@ -202,7 +203,7 @@ val examples = (project in file("examples"))
"lintAll",
"scalafixAll; scalafmtAll"
)
)*/
)

val root = (project in file("."))
.disablePlugins(ContribWarts)
Expand All @@ -213,7 +214,7 @@ val root = (project in file("."))
mockingbird,
`mockingbird-api`,
`mockingbird-native`,
// `edsl`
`edsl`
)
.settings(
run / aggregate := false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ trait AsyncScalaTestSuite extends AsyncFunSuiteLike {
*/
protected def generateTests(es: ExampleSet[HttpResponseR]): Unit =
es.examples.foreach { desc =>
test(desc.name)(desc.steps.foldMap(stepsBuilder).as(succeed))(desc.pos)
test(desc.name)(desc.steps.foldMap(stepsBuilder).as(succeed))
}

private[interpreter] def stepsBuilder: FunctionK[Step, Future] = new (Step ~> Future) {
Expand Down Expand Up @@ -94,7 +94,7 @@ trait AsyncScalaTestSuite extends AsyncFunSuiteLike {
|Value:
|${value}
|${clue.mkString("\n")}
|""".stripMargin)(pos)
|""".stripMargin)
case Valid(_) => succeed
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ final class MarkdownGenerator(baseUri: Uri) {

case CheckHttp(_, HttpResponseExpected(code, body, headers), _) =>
val bodyStr = body.map(_.show)
val cb = Vector(
val cb = Vector[Option[String]](
code.map(c => s"Response code: ${c.matcher.show}\n"),
headers.nonEmpty.option {
headers.map { case (k, v) => s"$k: '${v.matcher.show}'" }.mkString("Response headers:\n", "\n", "\n")
},
bodyStr.map("Response body:\n" ++ _ ++ "\n"),
bodyStr.map(bs => "Response body:\n".concat(bs).concat("\n")),
).flatten.mkString("\n")

Writer(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MarkdownGeneratorSuite extends AnyFunSuite with Matchers {

val mds = eset.describe(text).foldMap(mdg.stepsPrinterW).written
mds should have length 1
mds.head.md shouldBe ("\n" ++ text ++ "\n")
mds.head.md shouldBe ("\n".concat(text).concat("\n"))
}

test("sendHttp produces curl command") {
Expand Down

0 comments on commit d97d5e9

Please sign in to comment.