Skip to content

Fix any instance mark_invoked blocks not being cleared properly.

gitlab-qa-bot requested to merge any-instance-lifecycle-management into master

Created by: penelopezone

This issue was caused by the order that mocks were torn down in space.rb. This happened because (in order):

  1. Each mock proxy is verified
  2. Each any_instance recorder is verified

any_instance verification also currently holds the code for tearing down any_instance recorders also.

If any mock proxy through an exception whilst it was being verified then none of the any_instance recorders were verified (which makes sense as verification of mocks has already failed).

This patch adds a teardown of the any_instance_recorders in reset_all to RSpec::Mocks::Space

Closes: #534 (closed)

Merge request reports