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.



855
856
857
858
859
860
861
862
# File 'lib/test/unit/testcase.rb', line 855

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

Instance Attribute Details

#elapsed_timeObject (readonly)

Returns the value of attribute elapsed_time.



853
854
855
# File 'lib/test/unit/testcase.rb', line 853

def elapsed_time
  @elapsed_time
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



853
854
855
# File 'lib/test/unit/testcase.rb', line 853

def start_time
  @start_time
end

#test_dataObject (readonly)

Returns the value of attribute test_data.



854
855
856
# File 'lib/test/unit/testcase.rb', line 854

def test_data
  @test_data
end

#test_data_labelObject (readonly)

Returns the value of attribute test_data_label.



854
855
856
# File 'lib/test/unit/testcase.rb', line 854

def test_data_label
  @test_data_label
end

Instance Method Details

#assign_test_data(label, data) ⇒ Object



872
873
874
875
# File 'lib/test/unit/testcase.rb', line 872

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

#have_test_data?Boolean

Returns:

  • (Boolean)


877
878
879
# File 'lib/test/unit/testcase.rb', line 877

def have_test_data?
  not @test_data_label.nil?
end

#interruptedObject



893
894
895
# File 'lib/test/unit/testcase.rb', line 893

def interrupted
  @interrupted = true
end

#interrupted?Boolean

Returns:

  • (Boolean)


868
869
870
# File 'lib/test/unit/testcase.rb', line 868

def interrupted?
  @interrupted
end

#passed?Boolean

Returns:

  • (Boolean)


864
865
866
# File 'lib/test/unit/testcase.rb', line 864

def passed?
  @passed
end

#problem_occurredObject



889
890
891
# File 'lib/test/unit/testcase.rb', line 889

def problem_occurred
  @passed = false
end

#test_finishedObject



885
886
887
# File 'lib/test/unit/testcase.rb', line 885

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

#test_startedObject



881
882
883
# File 'lib/test/unit/testcase.rb', line 881

def test_started
  @start_time = Time.now
end