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

#initialize ⇒ InternalData

Returns a new instance of InternalData.



1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
# File 'lib/test/unit/testcase.rb', line 1073

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

Instance Attribute Details

#elapsed_time ⇒ Object (readonly)

Returns the value of attribute elapsed_time.



1068
1069
1070
# File 'lib/test/unit/testcase.rb', line 1068

def elapsed_time
  @elapsed_time
end

#n_assertions ⇒ Object

Returns the value of attribute n_assertions.



1072
1073
1074
# File 'lib/test/unit/testcase.rb', line 1072

def n_assertions
  @n_assertions
end

#run_context ⇒ Object

Returns the value of attribute run_context.



1070
1071
1072
# File 'lib/test/unit/testcase.rb', line 1070

def run_context
  @run_context
end

#start_time ⇒ Object (readonly)

Returns the value of attribute start_time.



1068
1069
1070
# File 'lib/test/unit/testcase.rb', line 1068

def start_time
  @start_time
end

#test_data ⇒ Object (readonly)

Returns the value of attribute test_data.



1069
1070
1071
# File 'lib/test/unit/testcase.rb', line 1069

def test_data
  @test_data
end

#test_data_label ⇒ Object (readonly)

Returns the value of attribute test_data_label.



1069
1070
1071
# File 'lib/test/unit/testcase.rb', line 1069

def test_data_label
  @test_data_label
end

#worker_id ⇒ Object

Returns the value of attribute worker_id.



1071
1072
1073
# File 'lib/test/unit/testcase.rb', line 1071

def worker_id
  @worker_id
end

Instance Method Details

#assign_test_data(label, data) ⇒ Object



1103
1104
1105
1106
# File 'lib/test/unit/testcase.rb', line 1103

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

#errored ⇒ Object



1132
1133
1134
# File 'lib/test/unit/testcase.rb', line 1132

def errored
  @errored = true
end

#errored? ⇒ Boolean

Returns:

  • (Boolean)


1099
1100
1101
# File 'lib/test/unit/testcase.rb', line 1099

def errored?
  @errored
end

#have_test_data? ⇒ Boolean

Returns:

  • (Boolean)


1108
1109
1110
# File 'lib/test/unit/testcase.rb', line 1108

def have_test_data?
  not @test_data_label.nil?
end

#interrupted ⇒ Object



1124
1125
1126
# File 'lib/test/unit/testcase.rb', line 1124

def interrupted
  @interrupted = true
end

#interrupted? ⇒ Boolean

Returns:

  • (Boolean)


1091
1092
1093
# File 'lib/test/unit/testcase.rb', line 1091

def interrupted?
  @interrupted
end

#marshal_dump ⇒ Object



1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
# File 'lib/test/unit/testcase.rb', line 1136

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

#marshal_load(data) ⇒ Object



1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
# File 'lib/test/unit/testcase.rb', line 1149

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

#omitted ⇒ Object



1128
1129
1130
# File 'lib/test/unit/testcase.rb', line 1128

def omitted
  @omitted = true
end

#omitted? ⇒ Boolean

Returns:

  • (Boolean)


1095
1096
1097
# File 'lib/test/unit/testcase.rb', line 1095

def omitted?
  @omitted
end

#passed? ⇒ Boolean

Returns:

  • (Boolean)


1087
1088
1089
# File 'lib/test/unit/testcase.rb', line 1087

def passed?
  @passed
end

#problem_occurred ⇒ Object



1120
1121
1122
# File 'lib/test/unit/testcase.rb', line 1120

def problem_occurred
  @passed = false
end

#test_finished ⇒ Object



1116
1117
1118
# File 'lib/test/unit/testcase.rb', line 1116

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

#test_started ⇒ Object



1112
1113
1114
# File 'lib/test/unit/testcase.rb', line 1112

def test_started
  @start_time = Time.now
end