Sha256: ae4bb4eecdaee621652b453e5657f9547510e2395425af047a7bea56da68a549

Contents?: true

Size: 574 Bytes

Versions: 2

Compression:

Stored size: 574 Bytes

Contents

require "petitest/subscribers/base_subscriber"
require "time"

module Petitest
  module Subscribers
    class TimerSubscriber < ::Petitest::Subscribers::BaseSubscriber
      # @return [Time, nil]
      attr_accessor :finished_at

      # @return [Time, nil]
      attr_accessor :started_at

      # @note Override
      def after_running_test_cases(test_cases)
        super
        self.finished_at = ::Time.now
      end

      # @note Override
      def before_running_test_cases(test_cases)
        super
        self.started_at = ::Time.now
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
petitest-0.1.1 lib/petitest/subscribers/timer_subscriber.rb
petitest-0.1.0 lib/petitest/subscribers/timer_subscriber.rb