22: def run(reporter, setup_block, teardown_block, dry_run, execution_context)
23: reporter.spec_started(@name) if reporter
24: return reporter.spec_finished(@name) if dry_run
25:
26: errors = []
27: begin
28: set_current
29: setup_ok = setup_spec(execution_context, errors, &setup_block)
30: spec_ok = execute_spec(execution_context, errors) if setup_ok
31: teardown_ok = teardown_spec(execution_context, errors, &teardown_block)
32: ensure
33: clear_current
34: end
35:
36: SpecShouldRaiseHandler.new(@from, @options).handle(errors)
37: reporter.spec_finished(@name, errors.first, failure_location(setup_ok, spec_ok, teardown_ok)) if reporter
38: end