Class: Timebomb::CLIReport
- Inherits:
-
Object
- Object
- Timebomb::CLIReport
- Defined in:
- lib/timebomb.rb
Constant Summary collapse
- RED_COLOR_CODE =
31
Instance Attribute Summary collapse
-
#suite ⇒ Object
readonly
Returns the value of attribute suite.
Instance Method Summary collapse
-
#initialize(suite) ⇒ CLIReport
constructor
A new instance of CLIReport.
- #print(out) ⇒ Object
Constructor Details
#initialize(suite) ⇒ CLIReport
Returns a new instance of CLIReport.
105 106 107 |
# File 'lib/timebomb.rb', line 105 def initialize(suite) @suite = suite end |
Instance Attribute Details
#suite ⇒ Object (readonly)
Returns the value of attribute suite.
103 104 105 |
# File 'lib/timebomb.rb', line 103 def suite @suite end |
Instance Method Details
#print(out) ⇒ Object
109 110 111 112 113 114 115 116 117 |
# File 'lib/timebomb.rb', line 109 def print(out) out.puts "Detected #{suite.timebombs.count} timebombs" suite.timebombs.each do |tb| out.puts timebomb_line(tb) end if suite.has_exploded? out.puts "#{suite.exploded_timebombs.count} timebombs have exploded!" end end |