Class Spec::Runner::Specification
In: lib/spec/runner/specification.rb
Parent: Object

Methods

matches_matcher?   new   run  

Classes and Modules

Module Spec::Runner::Specification::ClassMethods

Attributes

command  [R] 

Public Class methods

[Source]

    # File lib/spec/runner/specification.rb, line 15
15:       def initialize(name, opts={}, &block)
16:         @from = caller(0)[3]
17:         @name = name
18:         @options = opts
19:         @command = block
20:       end

Public Instance methods

[Source]

    # File lib/spec/runner/specification.rb, line 40
40:       def matches_matcher?(matcher)
41:         matcher.matches? @name 
42:       end

[Source]

    # File lib/spec/runner/specification.rb, line 22
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

[Validate]