Module: OnlyofficeTcmHelper::TimeHelper

Included in:
TcmHelper
Defined in:
lib/onlyoffice_tcm_helper/helpers/time_helper.rb

Overview

it is helper for work with time class

Instance Method Summary collapse

Instance Method Details

#example_time_in_seconds(example) ⇒ String

Example time in seconds

Parameters:

  • example (Object)

    with data

Returns:

  • (String)

    time in seconds



10
11
12
13
14
# File 'lib/onlyoffice_tcm_helper/helpers/time_helper.rb', line 10

def example_time_in_seconds(example)
  execution_time = (Time.now - example.[:execution_result].started_at).to_i
  execution_time = 1 if execution_time.zero? # Testrail cannot receive 0 as elapsed time
  "#{execution_time}s"
end