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

- old
+ new

@@ -1,11 +1,16 @@ require "json" -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 JsonReportSubscriber < ::Petitest::Subscribers::TimerSubscriber + class JsonReportSubscriber < ::Petitest::Subscribers::BaseSubscriber + include ::Petitest::SubscriberConcerns::OutputConcern + include ::Petitest::SubscriberConcerns::TimeConcern + # @note Override def after_running_test_cases(test_cases) super data = { test_cases: test_cases.map do |test_case| @@ -29,11 +34,11 @@ times: { finished_at: finished_at.iso8601(6), started_at: started_at.iso8601(6), }, } - output = ::JSON.pretty_generate(data) - puts output + string = ::JSON.pretty_generate(data) + output.puts(string) end end end end