Class: Dest::Formatter
- Inherits:
-
Object
- Object
- Dest::Formatter
- Defined in:
- lib/dest/formatter.rb
Constant Summary collapse
- @@fail_count =
0
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(evald_result) ⇒ Formatter
constructor
A new instance of Formatter.
- #print ⇒ Object
Constructor Details
#initialize(evald_result) ⇒ Formatter
Returns a new instance of Formatter.
17 18 19 |
# File 'lib/dest/formatter.rb', line 17 def initialize(evald_result) @evald_result = evald_result end |
Class Method Details
.print_end_test_message(time_taken, total_tests) ⇒ Object
31 32 33 34 |
# File 'lib/dest/formatter.rb', line 31 def self.(time_taken, total_tests) puts "\nFinished in #{time_taken} seconds \n" + "#{total_tests} tests,".green + " #{@@fail_count} failures".red end |
Instance Method Details
#print ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/dest/formatter.rb', line 21 def print if @evald_result[:result][0] print_passing_test else @@fail_count += 1 print_failing_test end end |