lib/petitest/subscribers/progress_report_subscriber.rb in petitest-0.1.1 vs lib/petitest/subscribers/progress_report_subscriber.rb in petitest-0.1.2

- old
+ new

@@ -1,23 +1,30 @@ -require "petitest/subscribers/timer_subscriber" +require "petitest/subscribers/base_subscriber" +require "petitest/subscriber_concerns/output_concern" +require "petitest/subscriber_concerns/time_concern" module Petitest module Subscribers - class ProgressReportSubscriber < ::Petitest::Subscribers::TimerSubscriber + class ProgressReportSubscriber < ::Petitest::Subscribers::BaseSubscriber + include ::Petitest::SubscriberConcerns::OutputConcern + include ::Petitest::SubscriberConcerns::TimeConcern + # @note Override def after_running_test_case(test_case) super - print ::Petitest::Texts::TestCaseResultCharacterText.new(test_case: test_case) + string = ::Petitest::Texts::TestCaseResultCharacterText.new(test_case: test_case).to_s + output.print(string) end # @note Override def after_running_test_cases(test_cases) super - puts ::Petitest::Texts::TestCasesResultText.new( + string = ::Petitest::Texts::TestCasesResultText.new( finished_at: finished_at, started_at: started_at, test_cases: test_cases, - ) + ).to_s + output.puts(string) end end end end