Skip to content

Commit

Permalink
Lint edsl
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Mar 31, 2024
1 parent 8848c61 commit 5b4da59
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ trait ExampleSet[HttpResponseR] {
liftF[Step, Unit](Describe(text, pos))

/**
* In tests, makes an HTTP request with the specified parameters or adds a sample request to the Markdown,
* which can be executed with the curl command.
* In tests, makes an HTTP request with the specified parameters or adds a sample request to the Markdown, which can
* be executed with the curl command.
*
* @param method
* HTTP method used.
Expand All @@ -41,9 +41,8 @@ trait ExampleSet[HttpResponseR] {
* @param query
* URL query parameters.
* @return
* Returns an object representing the result of the request execution;
* the specific type depends on the DSL interpreter.
* The return value can only be used by passing it to the [[checkHttp]] method.
* Returns an object representing the result of the request execution; the specific type depends on the DSL
* interpreter. The return value can only be used by passing it to the [[checkHttp]] method.
*/
final def sendHttp(
method: HttpMethod,
Expand All @@ -57,20 +56,18 @@ trait ExampleSet[HttpResponseR] {
liftF[Step, HttpResponseR](SendHttp[HttpResponseR](HttpRequest(method, path, body, headers, query), pos))

/**
* In tests, verifies that the received HTTP response matches the expectations.
* When generating Markdown, inserts the expected response based on the specified expectations.
* If no expectations are specified, nothing will be added.
* In tests, verifies that the received HTTP response matches the expectations. When generating Markdown, inserts the
* expected response based on the specified expectations. If no expectations are specified, nothing will be added.
*
* @param response
* the result of executing [[sendHttp]], the type depends on the DSL interpreter.
* @param expects
* expectations placed on the result of the HTTP request.
* Expectations concern the response code, request body, and headers received from the server.
* expectations placed on the result of the HTTP request. Expectations concern the response code, request body, and
* headers received from the server.
* @return
* returns the parsed response from the server. When generating Markdown,
* since there is no actual response from the server, it constructs a response based
* on the provided response expectations.
* Only information relevant to the specified checks is added to the Markdown.
* returns the parsed response from the server. When generating Markdown, since there is no actual response from the
* server, it constructs a response based on the provided response expectations. Only information relevant to the
* specified checks is added to the Markdown.
*/
final def checkHttp(response: HttpResponseR, expects: HttpResponseExpected)(implicit
pos: source.Position
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import ru.tinkoff.tcb.mockingbird.edsl.model.ValueMatcher.*
/**
* Base trait for generating a set of tests from an [[ru.tinkoff.tcb.mockingbird.edsl.ExampleSet ExampleSet]].
*
* This trait inherits from AsyncFunSuiteLike in the [[https://www.scalatest.org/ ScalaTest]] framework, so you can
* add additional tests inside it or use
* This trait inherits from AsyncFunSuiteLike in the [[https://www.scalatest.org/ ScalaTest]] framework, so you can add
* additional tests inside it or use
* [[https://www.scalatest.org/user_guide/sharing_fixtures#beforeAndAfter BeforeAndAfter]] and/or
* [[https://www.scalatest.org/user_guide/sharing_fixtures#composingFixtures BeforeAndAfterEach]] to manage
* the setup of the necessary environment for executing tests, including using
* [[https://www.scalatest.org/user_guide/sharing_fixtures#composingFixtures BeforeAndAfterEach]] to manage the setup of
* the necessary environment for executing tests, including using
* [[https://github.com/testcontainers/testcontainers-scala testcontainers-scala]].
*/
trait AsyncScalaTestSuite extends AsyncFunSuiteLike {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ sealed trait ValueMatcher[T] extends Product with Serializable
object ValueMatcher {

/**
* Indicates that a specific value of type 'T' is expected, and if there is a mismatch,
* the generated test will fail with an error.
* Indicates that a specific value of type 'T' is expected, and if there is a mismatch, the generated test will fail
* with an error.
*
* @param value
* The value used for comparison and display when generating an example server response in markdown.
Expand All @@ -18,7 +18,8 @@ object ValueMatcher {
* Indicates that any value of type 'T' is expected.
*
* @param example
* This value will be displayed in the markdown document when generated in the description of the example server response.
* This value will be displayed in the markdown document when generated in the description of the example server
* response.
*/
final case class AnyValue[T](example: T) extends ValueMatcher[T]

Expand Down Expand Up @@ -61,7 +62,8 @@ object Check {
final case class CheckInteger(matcher: ValueMatcher[Long]) extends Check

/**
* Indicates that JSON is expected. Implementations of this trait allow for a more detailed description of expectations.
* Indicates that JSON is expected. Implementations of this trait allow for a more detailed description of
* expectations.
* @group CheckJson
*/
sealed trait CheckJson extends Check
Expand Down Expand Up @@ -89,7 +91,8 @@ object Check {
final case class CheckJsonObject(fields: (String, CheckJson)*) extends CheckJson

/**
* An array with the specified elements, the order is important. The array being checked may contain additional elements at the end.
* An array with the specified elements, the order is important. The array being checked may contain additional
* elements at the end.
* @group CheckJson
*/
final case class CheckJsonArray(items: CheckJson*) extends CheckJson
Expand Down

0 comments on commit 5b4da59

Please sign in to comment.