meilisearch-ruby
meilisearch-ruby copied to clipboard
Improve the test structure by reducing duplication
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.