meilisearch / meilisearch/meilisearch-ruby

Improve the test structure by reducing duplication

Open
#287 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.