Closed codedeleter closed 2 years ago
From what I observe, test names are typically brief and usually follow your example structure above. You can see this from Minitest's own tests:
https://github.com/seattlerb/minitest/blob/master/test/minitest/test_minitest_mock.rb
One difference from RSpec is that deeply nested contexts could result in very long test names in minitest. But I think this actually a good thing, as that often indicates a class has too much behaviour, and encourages refactoring.
Closing since it doesn't seem there any guidance to be added at this time.
Are there any good conventions for naming individual tests?
I'm used to rspec with
describe "#method"
and then acontext "when blah blah"
and thenit "does the thing"
, which is a pretty easy kind of format to follow.But I'm trying out minitest and I'm not sure how to do naming for
def test_does_the_thing_when_blah