Occasionally, an example will have an omitted expectation. This could happen from a hairy git merge, or just plain distraction. Is there anyway to configure Rspec to fail the example if there is no expectation?
1 Like
If something like this doesnât exist, it might be an awesome PR candidate for RSpec.
Related note:
I really like the skip
/pending
functionality in RSpec now, where pending
specs that donât fail within it
blocks produce test failures.
Looks like itâs been talked about long ago here: Feature Idea: Fail examples when no expectation was set ¡ Issue #404 ¡ rspec/rspec-core ¡ GitHub
The consensus seemed to be that it would cause too much coupling between the rspec-core
and rspec-expectations
libraries. myronmarston put together an example of how something like this could work, but itâs pretty old and doesnât seem to anymore.