rspec-expectations icon indicating copy to clipboard operation
rspec-expectations copied to clipboard

"NotImplementedError: `expect { }.not_to change { }.by()` is not supported" - would be nice to improve

Open loqimean opened this issue 2 years ago • 2 comments

Hi, there is an error when you add .by(..) to your expect {}.not_to change(some, :attr), like expect {}.not_to change(some, :attr).by(1) that says "NotImplementedError: expect { }.not_to change { }.by() is not supported" and.., it's really not good, because you see the first things that say "You can use change matcher with the block" but you miss that there is a problem 'cause you forget to delete or just added .by(..) to your matcher. My solution: To change the error message like to this: Hey, you cannot use '.by(1)' in your <code> matcher, it is not supported, delete it or change matcher, please. *Would be fun if the message can be like this, please ^-^

loqimean avatar Oct 17 '23 10:10 loqimean