Sha256: 2ca5d11d47281f469e1fbfad94f05a53698e00c836ec834dea27050936263387

Contents?: true

Size: 550 Bytes

Versions: 2

Compression:

Stored size: 550 Bytes

Contents

require_relative 'message'

module Torkify::Event

  # Event used when all tests have finished running.
  #
  # The time method gives the approximate time in seconds that the tests
  # took to run.
  class RanAllTestFilesEvent < Struct.new(:type, :passed, :failed)
    include Message

    def initialize(type, passed = [], failed = [])
      @created = Time.now.to_f
      super
    end

    def stop!
      if @time.nil?
        @time = Time.now.to_f - @created
      end
      self
    end

    def time
      stop!
      @time
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
torkify-0.0.3 lib/torkify/event/ran_all_test_files_event.rb
torkify-0.0.2 lib/torkify/event/ran_all_test_files_event.rb