meilisearch / meilisearch/meilisearch-ruby
Improve the test structure by reducing duplication
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 224
- Forks
- 54
- PR merge metrics
- No merged PRs in 30d
Description
After #237 #217 which adds snake_case support, we improve our public API to be more idiomatic.
But we introduced a new problem regarding the tests.
In this comment, I raise the problem to @curquiza about a way to reduce this duplication without losing our coverage on each topic.
One possible question to be answered in this issue is: do we really need to test the snake_case support in every public method? Or just ensuring they will be parsed correctly is enough?
If we don’t need to test we should:
- Remove all the already duplicated test use-cases.
- Ensure that we will have a good coverage about ensuring the params parsing for each method.
otherwise:
- Provide a way to test these multiple ways to send the params (using snake_case or not) without duplication.
- Refactor the specs to support this new way to do tests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issues #237 and #217 and the referenced discussion in pull request #273 about duplicated snake_case test coverage. Determine whether parsing coverage can be centralized or whether each public method needs both parameter forms; done means the test cases are no longer duplicated while parameter parsing remains covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100