method
execute
1.2.0 -
Show latest stable
- Class:
Spec::Example::ExampleMethods
execute(run_options, instance_variables)public
No documentation available.
# File lib/spec/example/example_methods.rb, line 28
def execute(run_options, instance_variables) # :nodoc:
# FIXME - there is no reason to have example_started pass a name
# - in fact, it would introduce bugs in cases where no docstring
# is passed to it()
run_options.reporter.example_started("")
set_instance_variables_from_hash(instance_variables)
execution_error = nil
Timeout.timeout(run_options.timeout) do
begin
before_each_example
instance_eval(&@_implementation)
rescue Exception => e
execution_error ||= e
end
begin
after_each_example
rescue Exception => e
execution_error ||= e
end
end
run_options.reporter.example_finished(ExampleDescription.new(description, options), execution_error)
success = execution_error.nil? || ExamplePendingError === execution_error
end