module RSpec::SleepingKingStudios::Deferred::Dsl::Hooks
Domain-specific language for defining deferred hooks.
Public Instance Methods
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 19 def after(scope, *flags, **conditions, &) deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new( :after, scope, *flags, **conditions, & ) end
@overload after(scope, *flags, **conditions, &block)
Defines a deferred hook using the #after method. @param scope [Symbol] the scope for the hook. Must be one of :context, :each, or :example. @param flags [Array<Symbol>] condition flags for the hook. Will be transformed into conditions entries with true values. @param block [Proc] the implementation of the hook. @return [void]
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 39 def append_after(scope, *flags, **conditions, &) deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new( :append_after, scope, *flags, **conditions, & ) end
@overload append_after
(scope, *flags, **conditions, &block)
Defines a deferred hook using the #append_after method. @param scope [Symbol] the scope for the hook. Must be one of :context, :each, or :example. @param flags [Array<Symbol>] condition flags for the hook. Will be transformed into conditions entries with true values. @param block [Proc] the implementation of the hook. @return [void]
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 59 def around(scope, *flags, **conditions, &) deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new( :around, scope, *flags, **conditions, & ) end
@overload around(scope, *flags, **conditions, &block)
Defines a deferred hook using the #around method. @param scope [Symbol] the scope for the hook. Must be one of :context, :each, or :example. @param flags [Array<Symbol>] condition flags for the hook. Will be transformed into conditions entries with true values. @param block [Proc] the implementation of the hook. @return [void]
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 79 def before(scope, *flags, **conditions, &) deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new( :before, scope, *flags, **conditions, & ) end
@overload before(scope, *flags, **conditions, &block)
Defines a deferred hook using the #before method. @param scope [Symbol] the scope for the hook. Must be one of :context, :each, or :example. @param flags [Array<Symbol>] condition flags for the hook. Will be transformed into conditions entries with true values. @param block [Proc] the implementation of the hook. @return [void]
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 90 def call(example_group) super deferred_hooks.reverse_each do |deferred_hook| deferred_hook.call(example_group) end end
(see RSpec::SleepingKingStudios::Deferred::Definitions#call
)
Calls superclass method
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 99 def deferred_hooks @deferred_hooks ||= [] end
@private
Source
# File lib/rspec/sleeping_king_studios/deferred/dsl/hooks.rb, line 113 def prepend_before(scope, *flags, **conditions, &) deferred_hooks << RSpec::SleepingKingStudios::Deferred::Calls::Hook.new( :prepend_before, scope, *flags, **conditions, & ) end
@overload prepend_before
(scope, *flags, **conditions, &block)
Defines a deferred hook using the #prepend_before method. @param scope [Symbol] the scope for the hook. Must be one of :context, :each, or :example. @param flags [Array<Symbol>] condition flags for the hook. Will be transformed into conditions entries with true values. @param block [Proc] the implementation of the hook. @return [void]