Skip to content

Ensure negative expectations raise during RSpec verification time.

gitlab-qa-bot requested to merge samphippen/fix-874 into master

Created by: penelopezone

During the execution of an example (as noted in #874 (closed)) it is possible for a framework that wraps a mocked object to catch the RSpec::Mocks::MockExpectationError raised by a negative expectation. This exception is thrown immediately and so if it is caught the running example will pass.

This patch causes message expectations to also raise the same error at verification time.

This commit does not have a passing spec suite, that is intentional. I want to get feedback on the implementation before I go through all the broken tests and fix them. The relevant new test can be found on lines 228 to 239 of receive_spec.rb

Merge request reports