module RSpec::Core::Hooks
def after(*args, &block)
- Note: - The `:scope` alias is only supported for hooks registered on
Note: - The `:example` and `:context` scopes are also available as
Other tags:
- See: Configuration -
See: SharedExampleGroup -
See: SharedContext -
See: ExampleGroup -
See: #around -
See: #before -
Parameters:
-
conditions
(Hash
) -- -
conditions
(Hash
) -- -
scope
(Symbol
) -- `:example`, `:context`, or `:suite` (defaults to -
scope
(Symbol
) -- `:example`, `:context`, or `:suite` (defaults to
Overloads:
-
after(conditions, &block)
-
after(scope, conditions, &block)
-
after(scope, &block)
-
after(&block)
Other tags:
- Api: - public
def after(*args, &block) hooks.register :prepend, :after, *args, &block end
def append_after(*args, &block)
scope (`:example`, `:context`, or `:suite`).
Adds `block` to the back of the list of `after` blocks in the same
def append_after(*args, &block) hooks.register :append, :after, *args, &block end
def around(*args, &block)
- Note: - `:example`/`:each` is the only supported scope.
Note: - the syntax of `around` is similar to that of `before` and `after`
Other tags:
- Yield: - the example to run
Parameters:
-
conditions
(Hash
) -- constrains this hook to examples matching -
conditions
(Hash
) -- constrains this hook to examples matching -
scope
(Symbol
) -- `:example` (defaults to `:example`) -
scope
(Symbol
) -- `:example` (defaults to `:example`)
Overloads:
-
around(conditions, &block)
-
around(scope, conditions, &block)
-
around(scope, &block)
-
around(&block)
Other tags:
- Api: - public
def around(*args, &block) hooks.register :prepend, :around, *args, &block end
def before(*args, &block)
- Note: - The `:scope` alias is only supported for hooks registered on
Note: - The `:example` and `:context` scopes are also available as
Other tags:
- Example: before(:context) declared in an {ExampleGroup} -
Example: before(:example) declared in an {ExampleGroup} -
Other tags:
- See: Configuration -
See: SharedExampleGroup -
See: SharedContext -
See: ExampleGroup -
See: #around -
See: #after -
Parameters:
-
conditions
(Hash
) -- -
conditions
(Hash
) -- -
scope
(Symbol
) -- `:example`, `:context`, or `:suite` -
scope
(Symbol
) -- `:example`, `:context`, or `:suite`
Overloads:
-
before(conditions, &block)
-
before(scope, conditions, &block)
-
before(scope, &block)
-
before(&block)
Other tags:
- Api: - public
def before(*args, &block) hooks.register :append, :before, *args, &block end
def hooks
- Private: -
def hooks @hooks ||= HookCollections.new(self, FilterableItemRepository::UpdateOptimized) end
def prepend_before(*args, &block)
scope (`:example`, `:context`, or `:suite`).
Adds `block` to the front of the list of `before` blocks in the same
def prepend_before(*args, &block) hooks.register :prepend, :before, *args, &block end