class RSpec::Core::Hooks::HookCollections

def matching_hooks_for(position, scope, example_or_group)

Experimental RBS support (using type sampling data from the type_fusion project).

def matching_hooks_for: (Symbol position, Symbol scope, RSpec::Core::Example example_or_group) -> untyped

This signature was generated using 3 samples from 1 application.

def matching_hooks_for(position, scope, example_or_group)
  repository = hooks_for(position, scope) { return EMPTY_HOOK_ARRAY }
  # It would be nice to not have to switch on type here, but
  # we don't want to define `ExampleGroup#metadata` because then
  # `metadata` from within an individual example would return the
  # group's metadata but the user would probably expect it to be
  # the example's metadata.
  metadata = case example_or_group
             when ExampleGroup then example_or_group.class.metadata
             else example_or_group.metadata
             end
  repository.items_for(metadata)
end