Add repro specs for when_first_matching_example_defined bugs
Add repro specs for when_first_matching_example_defined bugs

The when_first_matching_example_defined hooks are registered on
@derived_metadata_blocks, which is an instance of
FilterableItemRepository::QueryOptimized, and unregistered on the first
invocation, so that they won't run multiple times.

https://github.com/rspec/rspec-core/blob/v3.5.4/lib/rspec/core/configuration.rb#L1724

However, they are actually unregistered _only_ from the internal
memoized cache for a particular metadata in
FilterableItemRepository::QueryOptimized. As a result, the hooks would
be invoked multiple times in the following cases:

* When the memoized cache is not used.
  In particular, when the value of the hook's metadata is a Proc.
* When the hooks are memoized in combination with another registered
  metadata before the first invocation.

rspec/rspec-core,rspec/rspec-core,rspec/rspec-core