module RSpec::Core::Hooks

def before(*args, &block)

Other tags:
    Example: before(:all) declared in an [ExampleGroup](ExampleGroup) -
    Example: before(:each) declared in an [ExampleGroup](ExampleGroup) -

Other tags:
    See: Configuration -
    See: SharedExampleGroup -
    See: SharedContext -
    See: ExampleGroup -
    See: #around -
    See: #after -

Parameters:
  • conditions (Hash) --
  • scope (Symbol) -- `:each`, `:all`, or `:suite` (defaults to `:each`)

Overloads:
  • before(conditions, &block)
  • before(scope, conditions, &block)
  • before(scope, &block)
  • before(&block)

Other tags:
    Api: - public
def before(*args, &block)
  scope, options = scope_and_options_from(*args)
  hooks[:before][scope] << BeforeHook.new(options, &block)
end