Skip to content

Commit 1ffc7a3

Browse files
scalafmt
1 parent 4ba53c3 commit 1ffc7a3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

smoketests/src/test/scala/org/scalaexercises/evaluator/Smoketests.scala

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,25 +29,30 @@ class Smoketests extends AnyFunSpec with Matchers with CirceInstances with Impli
2929
case _ => Uri.fromString("https://scala-evaluator-212.herokuapp.com/eval")
3030
})
3131
.handleErrorWith(_ =>
32-
IO.raiseError(new RuntimeException(
33-
s"Unable to parse the scala evaluator url for scala version ${BuildInfo.scalaVersion}")))
32+
IO.raiseError(
33+
new RuntimeException(
34+
s"Unable to parse the scala evaluator url for scala version ${BuildInfo.scalaVersion}"
35+
)
36+
)
37+
)
3438
.unsafeRunSync()
3539

3640
case class EvaluatorResponse(
3741
msg: String,
3842
value: String,
3943
valueType: String,
40-
compilationInfos: Map[String, String])
44+
compilationInfos: Map[String, String]
45+
)
4146

4247
implicit def decoder[F[_]: Sync]: EntityDecoder[F, EvaluatorResponse] =
4348
jsonOf[F, EvaluatorResponse]
4449

4550
val validToken =
4651
Jwt.encode("""{"user": "scala-exercises"}""", auth.secretKey, JwtAlgorithm.HS256)
4752

48-
def makeRequest(code: String)(
49-
expectation: EvaluatorResponse => Unit,
50-
failExpectation: Throwable => Unit = fail(_)): Unit = {
53+
def makeRequest(
54+
code: String
55+
)(expectation: EvaluatorResponse => Unit, failExpectation: Throwable => Unit = fail(_)): Unit = {
5156

5257
val request = Request[IO](method = Method.POST, uri = evaluatorUrl)
5358
.withEntity(s"""{"resolvers" : [], "dependencies" : [], "code" : "$code"}""")
@@ -72,9 +77,7 @@ class Smoketests extends AnyFunSpec with Matchers with CirceInstances with Impli
7277

7378
describe("Querying the /eval endpoint") {
7479
it("should succeed for a simple request") {
75-
makeRequest("1 + 1") { evaluatorResponse =>
76-
evaluatorResponse.value shouldBe "2"
77-
}
80+
makeRequest("1 + 1")(evaluatorResponse => evaluatorResponse.value shouldBe "2")
7881
}
7982

8083
it("should continue to work after calling System.exit") {
@@ -83,9 +86,7 @@ class Smoketests extends AnyFunSpec with Matchers with CirceInstances with Impli
8386
failExpectation = _ => ()
8487
)
8588

86-
makeRequest("1 + 1") { evaluatorResponse =>
87-
evaluatorResponse.value shouldBe "2"
88-
}
89+
makeRequest("1 + 1")(evaluatorResponse => evaluatorResponse.value shouldBe "2")
8990
}
9091

9192
it("should not expose sensitive details by calling sys.env") {

0 commit comments

Comments
 (0)