Class: L::Test::Reporter
- Defined in:
- lib/rub/l/test.rb
Instance Method Summary collapse
-
#initialize(opt = {}) ⇒ Reporter
constructor
A new instance of Reporter.
-
#passed? ⇒ Boolean
Did this run pass?.
-
#record(r) ⇒ Object
Record a result and output the Runnable#result_code.
-
#report ⇒ Object
Outputs the summary of the run.
-
#start ⇒ Object
Starts reporting on the run.
Constructor Details
#initialize(opt = {}) ⇒ Reporter
Returns a new instance of Reporter.
111 112 113 114 115 |
# File 'lib/rub/l/test.rb', line 111 def initialize(opt = {}) @passed = true @io = opt[:io] || $stdout end |
Instance Method Details
#passed? ⇒ Boolean
Did this run pass?
144 145 146 |
# File 'lib/rub/l/test.rb', line 144 def passed? @passed end |
#record(r) ⇒ Object
Record a result and output the Runnable#result_code. Stores the result of the run if the run did not pass.
125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/rub/l/test.rb', line 125 def record(r) pres = if r.skipped? "\e[34;1mSKIP\e[0m" elsif r.passed? "\e[32;1mPASS\e[0m" else "\e[31;1mFAIL\e[0m" end @io.puts "[#{pres}] #{r.class}##{r.name}" end |
#report ⇒ Object
Outputs the summary of the run.
139 140 |
# File 'lib/rub/l/test.rb', line 139 def report end |
#start ⇒ Object
Starts reporting on the run.
119 120 |
# File 'lib/rub/l/test.rb', line 119 def start end |