Class: RSpec::SleepingKingStudios::Deferred::Calls::ExampleGroup
- Inherits:
-
RSpec::SleepingKingStudios::Deferred::Call
- Object
- RSpec::SleepingKingStudios::Deferred::Call
- RSpec::SleepingKingStudios::Deferred::Calls::ExampleGroup
- Defined in:
- lib/rspec/sleeping_king_studios/deferred/calls/example_group.rb
Overview
Value object representing a deferred RSpec example group.
Instance Attribute Summary collapse
-
#deferred_example_group ⇒ Deferred::Examples
readonly
The deferred example group defining the deferred call.
Attributes inherited from RSpec::SleepingKingStudios::Deferred::Call
#arguments, #block, #keywords, #method_name
Instance Method Summary collapse
-
#call(receiver) ⇒ Object
Invokes the deferred method call on the receiver.
-
#initialize(method_name, *arguments, deferred_example_group: nil, **keywords, &block) ⇒ ExampleGroup
constructor
A new instance of ExampleGroup.
Methods inherited from RSpec::SleepingKingStudios::Deferred::Call
Constructor Details
#initialize(method_name, *arguments, deferred_example_group: nil, **keywords, &block) ⇒ ExampleGroup
Returns a new instance of ExampleGroup.
16 17 18 19 20 |
# File 'lib/rspec/sleeping_king_studios/deferred/calls/example_group.rb', line 16 def initialize(method_name, *, deferred_example_group: nil, **, &) super(method_name, *, **, &) @deferred_example_group = deferred_example_group end |
Instance Attribute Details
#deferred_example_group ⇒ Deferred::Examples (readonly)
Returns the deferred example group defining the deferred call.
24 25 26 |
# File 'lib/rspec/sleeping_king_studios/deferred/calls/example_group.rb', line 24 def deferred_example_group @deferred_example_group end |
Instance Method Details
#call(receiver) ⇒ Object
Invokes the deferred method call on the receiver.
27 28 29 30 31 32 33 34 35 |
# File 'lib/rspec/sleeping_king_studios/deferred/calls/example_group.rb', line 27 def call(receiver) example_group = super # Store a reference to the deferred group when adding to an actual example # group. example_group.[:deferred_example_group] = @deferred_example_group example_group end |