Method: RSpec::Core::Configuration#around

Defined in:
lib/rspec/core/configuration.rb

#around(scope = nil, *meta, &block) ⇒ void

Registers block as an around hook.

See Hooks#around for full around hook docs.



2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
# File 'lib/rspec/core/configuration.rb', line 2079

def around(scope=nil, *meta, &block)
  # defeat Ruby 2.5 lazy proc allocation to ensure
  # the methods below are passed the same proc instances
  # so `Hook` equality is preserved. For more info, see:
  # https://bugs.ruby-lang.org/issues/14045#note-5
  block.__id__

  add_hook_to_existing_matching_groups(meta, scope) { |g| g.around(scope, *meta, &block) }
  super(scope, *meta, &block)
end