Module: RSpec::Core::Example::Procsy
- Defined in:
- lib/rspec/core/example.rb
Overview
Procsy, itself, is not a public API, but we're documenting it
here to document how to interact with the object yielded to an
around
hook.
Used to extend a Proc
with behavior that makes it look something like
an RSpec::Core::Example in an around hook.
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
The
metadata
of the RSpec::Core::Example instance.
Class Method Summary collapse
-
.extended(proc) ⇒ Object
private
Adds a
run
method to the extended Proc, allowing it to be invoked in an around hook using eitherrun
orcall
.
Instance Method Summary collapse
- #with(metadata) ⇒ Object private
Instance Attribute Details
#metadata ⇒ Object (readonly)
The metadata
of the RSpec::Core::Example instance.
169 170 171 |
# File 'lib/rspec/core/example.rb', line 169 def @metadata end |
Class Method Details
.extended(proc) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Adds a run
method to the extended Proc, allowing it to be invoked
in an around hook using either
run
or call
.
176 177 178 179 180 |
# File 'lib/rspec/core/example.rb', line 176 def self.extended(proc) # @api public # Foo bar def proc.run; call; end end |
Instance Method Details
#with(metadata) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
183 184 185 186 |
# File 'lib/rspec/core/example.rb', line 183 def with() @metadata = self end |