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)
-
- (Object) metadata
readonly
The
metadata
of the RSpec::Core::Example instance.
Class Method Summary (collapse)
-
+ (Object) extended(proc)
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)
- - (Object) with(metadata) private
Instance Attribute Details
- (Object) metadata (readonly)
The metadata
of the RSpec::Core::Example instance.
168 169 170 |
# File 'lib/rspec/core/example.rb', line 168 def @metadata end |
Class Method Details
+ (Object) extended(proc)
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
.
175 176 177 178 179 |
# File 'lib/rspec/core/example.rb', line 175 def self.extended(proc) # @api public # Foo bar def proc.run; call; end end |
Instance Method Details
- (Object) with(metadata)
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.
182 183 184 185 |
# File 'lib/rspec/core/example.rb', line 182 def with() @metadata = self end |