56 ms·
Strange, RSpec seems to go in the opposite direction, used to be it 'should increment the counter' do ... but now the active voice preferred it 'incr
by jjgreen 4y ago
Strange, RSpec seems to go in the opposite direction, used to be
it 'should increment the counter' do ...
but now the active voice preferred
it 'increments the counter' do ...
I much prefer the latter.
- TomK32 4y agoI prefer the latter as well for the very simple reason that it takes a lot of letter reading the negative in following to realise it's a negative: it 'should not do something'
- MetaWhirledPeas 4y agoPeople are getting hung up on the word "should" but if you read the (very short) blog post it's really about what not to do. - Don't name your test "test [function name]" - Don't lean on comments to explain the test I agree it would be annoying to be forced into strict naming, but let's not ignore the author's point here.
- thunky 4y agoI'm not a fan of either, I would prefer counter_test.py: def test_increment(): assert ...