def self.store_and_call(world, type, name, *args, &block)
if block_given?
step_mother.store(type, Step.new(name, &block))
end
step = step_mother.find(type, name)
step_name = step.name
step_names << step_name
args = step.parse_args(name) if args.empty?
begin
listeners.each { |l| l.step_upcoming(type, step_name, *args) }
step.perform(world, *args) unless dry_run
listeners.each { |l| l.step_succeeded(type, step_name, *args) }
rescue Exception => e
case e
when Spec::Example::ExamplePendingError
@listeners.each { |l| l.step_pending(type, step_name, *args) }
else
@listeners.each { |l| l.step_failed(type, step_name, *args) }
end
errors << e
end
end