[TOOLING] Add fluent API to be_sorted matcher [RUN AS-IF-FOSS]
What does this MR do?
This improves the be_sorted
matcher by adding three fluent methods:
-
be_sorted.asc
: equivalent tobe_sorted(:identity, :asc)
-
be_sorted.desc
: equivalent tobe_sorted(:identity, :desc)
-
be_sorted.by(&projection)
: equivalent tobe_sorted(projection)
The rationale for this is:
it is much easier to see what the arguments mean, rather than using positional arguments, and it is much easier to pass complex projection logic rather than having to package it up as procs.
As a developer facing tooling change, this does not need a Changelog.
Tests are added for this matcher.
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry (not necessary) -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Edited by Alex Kalderimis