class RSpec::Core::Example::Procsy
proxying them through to the wrapped {Example} instance.
@note This class also exposes the instance methods of {Example},
end
end
ex.run # run delegates to ex.call
end
raise “some message”
if ex.metadata == :some_value && some_global_condition
c.around do |ex| # Procsy which wraps the example
RSpec.configure do |c|
@example
there are multiple ‘around` hooks we have to wrap them recursively.
kind of object (rather than the raw {Example}) because when
around} hooks. In around hooks we need to yield this special
Wraps both a `Proc` and an {Example} for use in {Hooks#around
def call(*args, &block)
def call(*args, &block) @executed = true @proc.call(*args, &block) end
def executed?
def executed? @executed end
def initialize(example, &block)
def initialize(example, &block) @example = example @proc = block @executed = false end
def inspect
- Private: -
def inspect @example.inspect.gsub('Example', 'ExampleProcsy') end
def to_proc
def to_proc method(:call).to_proc end
def wrap(&block)
- Private: -
def wrap(&block) self.class.new(example, &block) end