class Nitra::Formatter

Attributes

configuration[RW]
progress[RW]
start_time[RW]

Public Class Methods

new(progress, configuration) click to toggle source
# File lib/nitra/formatter.rb, line 8
def initialize(progress, configuration)
  self.progress = progress
  self.configuration = configuration
end

Public Instance Methods

finish() click to toggle source
# File lib/nitra/formatter.rb, line 23
def finish
  puts progress.filtered_output

  puts "\n#{overview}"
  puts "#{$aborted ? "Aborted after" : "Finished in"} #{"%0.1f" % (Time.now-start_time)} seconds"
end
print_progress() click to toggle source
start() click to toggle source
# File lib/nitra/formatter.rb, line 13
def start
  self.start_time = Time.now
  print_progress
end

Private Instance Methods

overview() click to toggle source

A simple overview of files processed so far and success/failure numbers.

# File lib/nitra/formatter.rb, line 55
def overview
  "#{progress.files_completed}/#{progress.file_count} files | #{progress.example_count} examples, #{progress.failure_count} failures"
end
print_bar() click to toggle source

Print the progress bar, doesn’t do anything if we’re in debug.

print_failures() click to toggle source

Prints the output in the progress object and resets it if we’ve got eager printing turned on.