@@ -72,17 +72,26 @@ object ClientTests extends SimpleIOSuite {
7272 req : Request [IO ]
7373 )(
7474 modDecoder : Decoder [A ] => Decoder [A ]
75- ): A = req.attributes.lookup(BodyJson ).get.as[A ](modDecoder(summon[Decoder [A ]])).toTry.get
75+ ): A =
76+ req
77+ .attributes
78+ .lookup(BodyJson )
79+ .get
80+ .as[A ](
81+ using modDecoder(summon[Decoder [A ]])
82+ )
83+ .toTry
84+ .get
7685
7786 test(" one op" ) {
7887 trait SimpleApi derives API {
7988 def op (): IO [Int ]
8089 }
8190
8291 fakeClient(42 ).flatMap { (client, uri, captured) =>
83- API [SimpleApi ].toClient(client, uri).op().map(assert .eql(42 , _)) *>
92+ API [SimpleApi ].toClient(client, uri).op().map(expect .eql(42 , _)) *>
8493 captured.map { req =>
85- assert .eql(" op" , methodHeader(req)) &&
94+ expect .eql(" op" , methodHeader(req)) &&
8695 succeed(bodyJsonDecode[Unit ](req))
8796 }
8897 }
@@ -94,9 +103,9 @@ object ClientTests extends SimpleIOSuite {
94103 }
95104
96105 fakeClient(42 ).flatMap { (client, uri, captured) =>
97- API [SimpleApi ].toClient(client, uri).op.map(assert .eql(42 , _)) *>
106+ API [SimpleApi ].toClient(client, uri).op.map(expect .eql(42 , _)) *>
98107 captured.map { req =>
99- assert .eql(" op" , methodHeader(req)) &&
108+ expect .eql(" op" , methodHeader(req)) &&
100109 succeed(bodyJsonDecode[Unit ](req))
101110 }
102111 }
@@ -108,10 +117,10 @@ object ClientTests extends SimpleIOSuite {
108117 }
109118
110119 fakeClient(" output" ).flatMap { (client, uri, captured) =>
111- API [SimpleApi ].toClient(client, uri).operation(42 ).map(assert .eql(" output" , _)) *>
120+ API [SimpleApi ].toClient(client, uri).operation(42 ).map(expect .eql(" output" , _)) *>
112121 captured.map { req =>
113- assert .eql(" operation" , methodHeader(req)) &&
114- assert .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" )))
122+ expect .eql(" operation" , methodHeader(req)) &&
123+ expect .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" )))
115124 }
116125 }
117126 }
@@ -127,10 +136,10 @@ object ClientTests extends SimpleIOSuite {
127136 API [SimpleApi ]
128137 .toClient(client, uri)
129138 .operation(Person (" John" , 42 ))
130- .map(assert .eql(Person (" John" , 43 ), _)) *>
139+ .map(expect .eql(Person (" John" , 43 ), _)) *>
131140 captured.map { req =>
132- assert .eql(" operation" , methodHeader(req)) &&
133- assert .eql(Person (" John" , 42 ), bodyJsonDecode[Person ](req)(_.at(" a" )))
141+ expect .eql(" operation" , methodHeader(req)) &&
142+ expect .eql(Person (" John" , 42 ), bodyJsonDecode[Person ](req)(_.at(" a" )))
134143 }
135144 }
136145 }
@@ -142,11 +151,11 @@ object ClientTests extends SimpleIOSuite {
142151 }
143152
144153 fakeClient(" 42 foo" ).flatMap { (client, uri, captured) =>
145- API [SimpleApi ].toClient(client, uri).operation(42 , " foo" ).map(assert .eql(" 42 foo" , _)) *>
154+ API [SimpleApi ].toClient(client, uri).operation(42 , " foo" ).map(expect .eql(" 42 foo" , _)) *>
146155 captured.map { req =>
147- assert .eql(" operation" , methodHeader(req)) &&
148- assert .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" ))) &&
149- assert .eql(" foo" , bodyJsonDecode[String ](req)(_.at(" b" )))
156+ expect .eql(" operation" , methodHeader(req)) &&
157+ expect .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" ))) &&
158+ expect .eql(" foo" , bodyJsonDecode[String ](req)(_.at(" b" )))
150159 }
151160 }
152161 }
@@ -158,11 +167,11 @@ object ClientTests extends SimpleIOSuite {
158167 }
159168
160169 fakeClient(" 42 foo" ).flatMap { (client, uri, captured) =>
161- API [SimpleApi ].toClient(client, uri).operation(42 )(" foo" ).map(assert .eql(" 42 foo" , _)) *>
170+ API [SimpleApi ].toClient(client, uri).operation(42 )(" foo" ).map(expect .eql(" 42 foo" , _)) *>
162171 captured.map { req =>
163- assert .eql(" operation" , methodHeader(req)) &&
164- assert .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" ))) &&
165- assert .eql(" foo" , bodyJsonDecode[String ](req)(_.at(" b" )))
172+ expect .eql(" operation" , methodHeader(req)) &&
173+ expect .eql(42 , bodyJsonDecode[Int ](req)(_.at(" a" ))) &&
174+ expect .eql(" foo" , bodyJsonDecode[String ](req)(_.at(" b" )))
166175 }
167176 }
168177 }
0 commit comments