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.



783
784
785
786
787
788
789
790
# File 'lib/test/unit/testcase.rb', line 783

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.



781
782
783
# File 'lib/test/unit/testcase.rb', line 781

def elapsed_time
  @elapsed_time
end

#start_timeObject (readonly)

Returns the value of attribute start_time.



781
782
783
# File 'lib/test/unit/testcase.rb', line 781

def start_time
  @start_time
end

#test_dataObject (readonly)

Returns the value of attribute test_data.



782
783
784
# File 'lib/test/unit/testcase.rb', line 782

def test_data
  @test_data
end

#test_data_labelObject (readonly)

Returns the value of attribute test_data_label.



782
783
784
# File 'lib/test/unit/testcase.rb', line 782

def test_data_label
  @test_data_label
end

Instance Method Details

#assign_test_data(label, data) ⇒ Object



800
801
802
803
# File 'lib/test/unit/testcase.rb', line 800

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

#have_test_data?Boolean

Returns:

  • (Boolean)


805
806
807
# File 'lib/test/unit/testcase.rb', line 805

def have_test_data?
  not @test_data_label.nil?
end

#interruptedObject



821
822
823
# File 'lib/test/unit/testcase.rb', line 821

def interrupted
  @interrupted = true
end

#interrupted?Boolean

Returns:

  • (Boolean)


796
797
798
# File 'lib/test/unit/testcase.rb', line 796

def interrupted?
  @interrupted
end

#passed?Boolean

Returns:

  • (Boolean)


792
793
794
# File 'lib/test/unit/testcase.rb', line 792

def passed?
  @passed
end

#problem_occurredObject



817
818
819
# File 'lib/test/unit/testcase.rb', line 817

def problem_occurred
  @passed = false
end

#test_finishedObject



813
814
815
# File 'lib/test/unit/testcase.rb', line 813

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

#test_startedObject



809
810
811
# File 'lib/test/unit/testcase.rb', line 809

def test_started
  @start_time = Time.now
end