Class: Quarry::Reporter
- Defined in:
- lib/quarry/reporter.rb,
lib/quarry/reporter/summary.rb,
lib/quarry/reporter/verbatim.rb,
lib/quarry/reporter/dotprogress.rb
Overview
:nodoc:
Direct Known Subclasses
Defined Under Namespace
Classes: DotProgress, Summary, Verbatim
Constant Summary collapse
- ANSICode =
Clio::ANSICode
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#fail ⇒ Object
readonly
Returns the value of attribute fail.
-
#pass ⇒ Object
readonly
Returns the value of attribute pass.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Instance Method Summary collapse
-
#initialize ⇒ Reporter
constructor
A new instance of Reporter.
-
#report_comment(step) ⇒ Object
Report a comment.
-
#report_end(spec) ⇒ Object
End of a specification.
-
#report_error(step, exception) ⇒ Object
Report step raised an error.
-
#report_fail(step, assertion) ⇒ Object
Report step failed.
-
#report_header(step) ⇒ Object
Report a header.
-
#report_intro ⇒ Object
Before running any specifications.
-
#report_macro(step) ⇒ Object
Since regular macro step does not pass or fail, this method is used instead.
-
#report_pass(step) ⇒ Object
Report step passed.
-
#report_start(spec) ⇒ Object
Beginning of a specification.
-
#report_step(step) ⇒ Object
Before running a step.
-
#report_step_end(step) ⇒ Object
After running a step.
-
#report_summary ⇒ Object
After running all specifications.
Constructor Details
#initialize ⇒ Reporter
Returns a new instance of Reporter.
19 20 21 22 23 24 25 |
# File 'lib/quarry/reporter.rb', line 19 def initialize @specs = 0 @steps = 0 @pass = [] @fail = [] @error = [] end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
17 18 19 |
# File 'lib/quarry/reporter.rb', line 17 def error @error end |
#fail ⇒ Object (readonly)
Returns the value of attribute fail.
16 17 18 |
# File 'lib/quarry/reporter.rb', line 16 def fail @fail end |
#pass ⇒ Object (readonly)
Returns the value of attribute pass.
15 16 17 |
# File 'lib/quarry/reporter.rb', line 15 def pass @pass end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
14 15 16 |
# File 'lib/quarry/reporter.rb', line 14 def steps @steps end |
Instance Method Details
#report_comment(step) ⇒ Object
Report a comment.
41 42 |
# File 'lib/quarry/reporter.rb', line 41 def report_comment(step) end |
#report_end(spec) ⇒ Object
End of a specification.
82 83 |
# File 'lib/quarry/reporter.rb', line 82 def report_end(spec) end |
#report_error(step, exception) ⇒ Object
Report step raised an error.
65 66 67 68 |
# File 'lib/quarry/reporter.rb', line 65 def report_error(step, exception) raise exception if $DEBUG @error << [step, exception] end |
#report_fail(step, assertion) ⇒ Object
Report step failed.
60 61 62 |
# File 'lib/quarry/reporter.rb', line 60 def report_fail(step, assertion) @fail << [step, assertion] end |
#report_header(step) ⇒ Object
Report a header.
37 38 |
# File 'lib/quarry/reporter.rb', line 37 def report_header(step) end |
#report_intro ⇒ Object
Before running any specifications.
28 29 |
# File 'lib/quarry/reporter.rb', line 28 def report_intro end |
#report_macro(step) ⇒ Object
Since regular macro step does not pass or fail, this method is used instead.
TODO: Rename to #report_nominal (?)
74 75 |
# File 'lib/quarry/reporter.rb', line 74 def report_macro(step) end |
#report_pass(step) ⇒ Object
Report step passed.
55 56 57 |
# File 'lib/quarry/reporter.rb', line 55 def report_pass(step) @pass << step end |
#report_start(spec) ⇒ Object
Beginning of a specification.
32 33 34 |
# File 'lib/quarry/reporter.rb', line 32 def report_start(spec) @specs += 1 end |
#report_step(step) ⇒ Object
Before running a step.
50 51 52 |
# File 'lib/quarry/reporter.rb', line 50 def report_step(step) @steps += 1 end |
#report_step_end(step) ⇒ Object
After running a step.
78 79 |
# File 'lib/quarry/reporter.rb', line 78 def report_step_end(step) end |
#report_summary ⇒ Object
After running all specifications.
86 87 |
# File 'lib/quarry/reporter.rb', line 86 def report_summary end |