Class: Dest::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/dest/formatter.rb

Constant Summary collapse

@@fail_count =
0

Class Method Summary collapse

Instance Method Summary collapse

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



31
32
33
34
# File 'lib/dest/formatter.rb', line 31

def self.print_end_test_message(time_taken, total_tests)
  puts "\nFinished in #{time_taken} seconds \n" + 
       "#{total_tests} tests,".green + " #{@@fail_count} failures".red 
end

Instance Method Details



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