rubocop / minitest-style-guide

Best practices for writing your tests
https://minitest.rubystyle.guide
70 stars 15 forks source link

Add warning about inheriting from other tests #45

Closed andyw8 closed 2 years ago

andyw8 commented 2 years ago

As illustrated in https://github.com/ignacio-chiazzo/ruby-minitest-analyzer

Minitest uses Ruby classes, if a Minitest class inherits from another class, it will also inherit its methods causing Minitest to run the parent's tests twice. In some cases, we want them to run them twice, but most of the time, we don't.

(cc @ignacio-chiazzo)

ignacio-chiazzo commented 2 years ago

I opened a PR for this https://github.com/rubocop/minitest-style-guide/pull/46. Thanks for bringing this up, Andy.