Parent

Class Index [+]

Quicksearch

Spec::Runner::Reporter

Constants

EXAMPLE_PENDING_DEPRECATION_WARNING

Attributes

options[R]

Public Class Methods

new(options) click to toggle source
    # File lib/spec/runner/reporter.rb, line 6
 6:       def initialize(options)
 7:         @options = options
 8:         @options.reporter = self
 9:         @failures = []
10:         @pending_count = 0
11:         @example_count = 0
12:         @start_time = nil
13:         @end_time = nil
14:       end

Public Instance Methods

dump() click to toggle source

Dumps the summary and returns the total number of failures

    # File lib/spec/runner/reporter.rb, line 58
58:       def dump
59:         formatters.each{|f| f.start_dump}
60:         dump_pending
61:         dump_failures
62:         formatters.each do |f|
63:           f.dump_summary(duration, @example_count, @failures.length, @pending_count)
64:           f.close
65:         end
66:         @failures.length
67:       end
end() click to toggle source
    # File lib/spec/runner/reporter.rb, line 53
53:       def end
54:         @end_time = Time.new
55:       end
example_failed(example, error) click to toggle source
    # File lib/spec/runner/reporter.rb, line 39
39:       def example_failed(example, error)
40:         backtrace_tweaker.tweak_backtrace(error)
41:         failure = Failure.new(@example_group.description, example.description, error)
42:         @failures << failure
43:         formatters.each do |f|
44:           f.example_failed(example, @failures.length, failure)
45:         end
46:       end
example_finished(example, error=nil) click to toggle source
    # File lib/spec/runner/reporter.rb, line 27
27:       def example_finished(example, error=nil)
28:         @example_count += 1
29:         
30:         if error.nil?
31:           example_passed(example)
32:         elsif Spec::Example::ExamplePendingError === error
33:           example_pending(example, example.location, error.message)
34:         else
35:           example_failed(example, error)
36:         end
37:       end
example_group_started(example_group) click to toggle source
    # File lib/spec/runner/reporter.rb, line 16
16:       def example_group_started(example_group)
17:         @example_group = example_group
18:         formatters.each do |f|
19:           f.example_group_started(example_group)
20:         end
21:       end
example_started(example) click to toggle source
    # File lib/spec/runner/reporter.rb, line 23
23:       def example_started(example)
24:         formatters.each{|f| f.example_started(example)}
25:       end
start(number_of_examples) click to toggle source
    # File lib/spec/runner/reporter.rb, line 48
48:       def start(number_of_examples)
49:         @start_time = Time.new
50:         formatters.each{|f| f.start(number_of_examples)}
51:       end

Private Instance Methods

backtrace_tweaker() click to toggle source
     # File lib/spec/runner/reporter.rb, line 114
114:       def backtrace_tweaker
115:         @options.backtrace_tweaker
116:       end
dump_failures() click to toggle source
     # File lib/spec/runner/reporter.rb, line 118
118:       def dump_failures
119:         return if @failures.empty?
120:         @failures.inject(1) do |index, failure|
121:           formatters.each{|f| f.dump_failure(index, failure)}
122:           index + 1
123:         end
124:       end
dump_pending() click to toggle source
     # File lib/spec/runner/reporter.rb, line 126
126:       def dump_pending
127:         formatters.each{|f| f.dump_pending}
128:       end
duration() click to toggle source
     # File lib/spec/runner/reporter.rb, line 130
130:       def duration
131:         return @end_time - @start_time unless (@end_time.nil? or @start_time.nil?)
132:         return "0.0"
133:       end
example_passed(example) click to toggle source
     # File lib/spec/runner/reporter.rb, line 135
135:       def example_passed(example)
136:         formatters.each{|f| f.example_passed(example)}
137:       end
example_pending(example, ignore, message="Not Yet Implemented") click to toggle source
     # File lib/spec/runner/reporter.rb, line 153
153:       def example_pending(example, ignore, message="Not Yet Implemented")
154:         @pending_count += 1
155:         formatters.each do |formatter|
156:           if formatter_uses_deprecated_example_pending_method?(formatter)
157:             Spec.warn EXAMPLE_PENDING_DEPRECATION_WARNING
158:             formatter.example_pending(example, message, example.location)
159:           else
160:             formatter.example_pending(example, message)
161:           end
162:         end
163:       end
formatter_uses_deprecated_example_pending_method?(formatter) click to toggle source
     # File lib/spec/runner/reporter.rb, line 165
165:       def formatter_uses_deprecated_example_pending_method?(formatter)
166:         formatter.method(:example_pending).arity == 3
167:       end
formatters() click to toggle source
     # File lib/spec/runner/reporter.rb, line 110
110:       def formatters
111:         @options.formatters
112:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.