Class: Test::Unit::TestCase::InternalData

Inherits:
Object
  • Object
show all
Defined in:
lib/test/unit/testcase.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeInternalData

Returns a new instance of InternalData.



994
995
996
997
998
999
1000
1001
1002
1003
# File 'lib/test/unit/testcase.rb', line 994

def initialize
  @start_time = nil
  @elapsed_time = nil
  @passed = true
  @interrupted = false
  @test_data_label = nil
  @test_data = nil
  @run_context = nil
  @worker_id = nil
end

Instance Attribute Details

#elapsed_timeObject (readonly)

Returns the value of attribute elapsed_time.



990
991
992
# File 'lib/test/unit/testcase.rb', line 990

def elapsed_time
  @elapsed_time
end

#run_contextObject

Returns the value of attribute run_context.



992
993
994
# File 'lib/test/unit/testcase.rb', line 992

def run_context
  @run_context
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



990
991
992
# File 'lib/test/unit/testcase.rb', line 990

def start_time
  @start_time
end

#test_dataObject (readonly)

Returns the value of attribute test_data.



991
992
993
# File 'lib/test/unit/testcase.rb', line 991

def test_data
  @test_data
end

#test_data_labelObject (readonly)

Returns the value of attribute test_data_label.



991
992
993
# File 'lib/test/unit/testcase.rb', line 991

def test_data_label
  @test_data_label
end

#worker_idObject

Returns the value of attribute worker_id.



993
994
995
# File 'lib/test/unit/testcase.rb', line 993

def worker_id
  @worker_id
end

Instance Method Details

#assign_test_data(label, data) ⇒ Object



1013
1014
1015
1016
# File 'lib/test/unit/testcase.rb', line 1013

def assign_test_data(label, data)
  @test_data_label = label
  @test_data = data
end

#have_test_data?Boolean

Returns:

  • (Boolean)


1018
1019
1020
# File 'lib/test/unit/testcase.rb', line 1018

def have_test_data?
  not @test_data_label.nil?
end

#interruptedObject



1034
1035
1036
# File 'lib/test/unit/testcase.rb', line 1034

def interrupted
  @interrupted = true
end

#interrupted?Boolean

Returns:

  • (Boolean)


1009
1010
1011
# File 'lib/test/unit/testcase.rb', line 1009

def interrupted?
  @interrupted
end

#marshal_dumpObject



1038
1039
1040
1041
1042
1043
1044
1045
1046
# File 'lib/test/unit/testcase.rb', line 1038

def marshal_dump
  {
    start_time: @start_time,
    elapsed_time: @elapsed_time,
    passed: @passed,
    interrupted: @interrupted,
    test_data_label: @test_data_label,
  }
end

#marshal_load(data) ⇒ Object



1048
1049
1050
1051
1052
1053
1054
# File 'lib/test/unit/testcase.rb', line 1048

def marshal_load(data)
  @start_time = data[:start_time]
  @elapsed_time = data[:elapsed_time]
  @passed = data[:passed]
  @interrupted = data[:interrupted]
  @test_data_label = data[:test_data_label]
end

#passed?Boolean

Returns:

  • (Boolean)


1005
1006
1007
# File 'lib/test/unit/testcase.rb', line 1005

def passed?
  @passed
end

#problem_occurredObject



1030
1031
1032
# File 'lib/test/unit/testcase.rb', line 1030

def problem_occurred
  @passed = false
end

#test_finishedObject



1026
1027
1028
# File 'lib/test/unit/testcase.rb', line 1026

def test_finished
  @elapsed_time = Time.now - @start_time
end

#test_startedObject



1022
1023
1024
# File 'lib/test/unit/testcase.rb', line 1022

def test_started
  @start_time = Time.now
end