Class: Tlb::RunData::Suite

Inherits:
Struct
  • Object
show all
Defined in:
lib/tlb/run_data.rb

Constant Summary collapse

MILLS_PER_SEC =
1000

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(identity, start_time) ⇒ Suite

Returns a new instance of Suite.



7
8
9
# File 'lib/tlb/run_data.rb', line 7

def initialize(identity, start_time)
  super(identity, start_time, start_time, false)
end

Instance Attribute Details

#end_timeObject

Returns the value of attribute end_time

Returns:

  • (Object)

    the current value of end_time



4
5
6
# File 'lib/tlb/run_data.rb', line 4

def end_time
  @end_time
end

#failedObject

Returns the value of attribute failed

Returns:

  • (Object)

    the current value of failed



4
5
6
# File 'lib/tlb/run_data.rb', line 4

def failed
  @failed
end

#identityObject

Returns the value of attribute identity

Returns:

  • (Object)

    the current value of identity



4
5
6
# File 'lib/tlb/run_data.rb', line 4

def identity
  @identity
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



4
5
6
# File 'lib/tlb/run_data.rb', line 4

def start_time
  @start_time
end

Instance Method Details

#for_id?(new_identity) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/tlb/run_data.rb', line 15

def for_id? new_identity
  identity == new_identity
end

#report_to_tlbObject



19
20
21
22
# File 'lib/tlb/run_data.rb', line 19

def report_to_tlb
  Tlb.suite_time(identity, run_time)
  Tlb.suite_result(identity, failed)
end

#run_timeObject



11
12
13
# File 'lib/tlb/run_data.rb', line 11

def run_time
  ((end_time - start_time)*MILLS_PER_SEC).to_i
end