lib/lemon/reporter.rb in lemon-0.6 vs lib/lemon/reporter.rb in lemon-0.7.0

- old
+ new

@@ -1,52 +1,22 @@ +require 'lemon/reporter/dotprogress' +require 'lemon/reporter/outline' +require 'lemon/reporter/verbose' + module Lemon +module Reporter - # = Reporter Base Class - class Reporter - - # - def self.factory(format, runner) - format = format.to_sym if format - case format - when :verbose - Reporters::Verbose.new(runner) - else - Reporters::DotProgress.new(runner) - end + # TODO: make Reporter#factory more dynamic + def self.factory(format, runner) + format = format.to_s if format + case format + when 'v', 'verb', 'verbose' + Reporter::Verbose.new(runner) + when 'o', 'out', 'outline' + Reporter::Outline.new(runner) + else + Reporter::DotProgress.new(runner) end - - def initialize(runner) - @runner = runner - end - - # - attr :runner - - # - def report_start(suite) - end - - def report_concern(concern) - end - - def report_success(testunit) - end - - def report_failure(testunit, exception) - end - - def report_error(testunit, exception) - end - - def report_finish - end - - private - - def successes ; runner.successes ; end - def failures ; runner.failures ; end - def errors ; runner.errors ; end - def pendings ; runner.pendings ; end - end +end end