@@ -60,9 +60,10 @@ module Hooks
60
60
# before(:example) # Declared in a parent group.
61
61
# before(:example) # Declared in the current group.
62
62
#
63
- # If more than one `before` is declared within any one scope, they are run
64
- # in the order in which they are declared. Any `around` hooks will execute
65
- # later than any `before` hook regardless of scope.
63
+ # If more than one `before` is declared within any one example group, they
64
+ # are run in the order in which they are declared. Any `around` hooks will
65
+ # execute after `before` context hooks but before any `before` example
66
+ # hook regardless of where they are declared.
66
67
#
67
68
# ### Conditions
68
69
#
@@ -263,9 +264,10 @@ def prepend_before(*args, &block)
263
264
# after(:suite) # Declared in RSpec.configure.
264
265
#
265
266
# This is the reverse of the order in which `before` hooks are run.
266
- # Similarly, if more than one `after` is declared within any one scope,
267
- # they are run in reverse order of that in which they are declared. Also
268
- # `around` hooks will all have run before any after hooks are invoked.
267
+ # Similarly, if more than one `after` is declared within any example
268
+ # group, they are run in reverse order of that in which they are declared.
269
+ # Also `around` hooks will run after any `after` example hooks are
270
+ # invoked but before any `after` context hooks.
269
271
#
270
272
# @note The `:example` and `:context` scopes are also available as
271
273
# `:each` and `:all`, respectively. Use whichever you prefer.
@@ -337,8 +339,11 @@ def append_after(*args, &block)
337
339
#
338
340
# ### Order
339
341
#
340
- # All `around` hooks execute immediately surrounding an example, this means
341
- # that all `before` hooks will have run and no `after` hooks will have run yet.
342
+ # The `around` hooks execute surrounding an example and its hooks.
343
+ #
344
+ # This means after any `before` context hooks, but before any `before`
345
+ # example hooks, and similarly after any `after` example hooks but before
346
+ # any `after` context hooks.
342
347
#
343
348
# They are not a synonym for `before`/`after`.
344
349
def around ( *args , &block )
0 commit comments