Class: DevCreek::TestSuite
- Inherits:
-
Object
- Object
- DevCreek::TestSuite
- Defined in:
- lib/devcreek_testsuite.rb
Instance Attribute Summary collapse
-
#elapsed_time ⇒ Object
Returns the value of attribute elapsed_time.
-
#finish ⇒ Object
readonly
Returns the value of attribute finish.
-
#framework ⇒ Object
readonly
Returns the value of attribute framework.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#test_results ⇒ Object
Returns the value of attribute test_results.
Instance Method Summary collapse
- #error_count ⇒ Object
- #failure_count ⇒ Object
- #has_finished ⇒ Object
- #has_test_results? ⇒ Boolean
-
#initialize(framework) ⇒ TestSuite
constructor
A new instance of TestSuite.
- #run_count ⇒ Object
- #success_count ⇒ Object
- #to_xml(session_id) ⇒ Object
Constructor Details
Instance Attribute Details
#elapsed_time ⇒ Object
Returns the value of attribute elapsed_time.
13 14 15 |
# File 'lib/devcreek_testsuite.rb', line 13 def elapsed_time @elapsed_time end |
#finish ⇒ Object (readonly)
Returns the value of attribute finish.
14 15 16 |
# File 'lib/devcreek_testsuite.rb', line 14 def finish @finish end |
#framework ⇒ Object (readonly)
Returns the value of attribute framework.
14 15 16 |
# File 'lib/devcreek_testsuite.rb', line 14 def framework @framework end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
14 15 16 |
# File 'lib/devcreek_testsuite.rb', line 14 def session_id @session_id end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
14 15 16 |
# File 'lib/devcreek_testsuite.rb', line 14 def start @start end |
#test_results ⇒ Object
Returns the value of attribute test_results.
13 14 15 |
# File 'lib/devcreek_testsuite.rb', line 13 def test_results @test_results end |
Instance Method Details
#error_count ⇒ Object
45 46 47 |
# File 'lib/devcreek_testsuite.rb', line 45 def error_count return sum_test_results_with_status("ERROR") end |
#failure_count ⇒ Object
41 42 43 |
# File 'lib/devcreek_testsuite.rb', line 41 def failure_count return sum_test_results_with_status("FAILURE") end |
#has_finished ⇒ Object
49 50 51 52 |
# File 'lib/devcreek_testsuite.rb', line 49 def has_finished raise ArgumentError, "The finish time cannot be set twice" unless @finish.nil? @finish = Time.now end |
#has_test_results? ⇒ Boolean
33 34 35 |
# File 'lib/devcreek_testsuite.rb', line 33 def has_test_results? return run_count > 0 end |
#run_count ⇒ Object
29 30 31 |
# File 'lib/devcreek_testsuite.rb', line 29 def run_count return test_results.size end |
#success_count ⇒ Object
37 38 39 |
# File 'lib/devcreek_testsuite.rb', line 37 def success_count return sum_test_results_with_status("OK") end |
#to_xml(session_id) ⇒ Object
54 55 56 |
# File 'lib/devcreek_testsuite.rb', line 54 def to_xml(session_id) ERB.new(DevCreek::TRANSMISSION_RECORD_TEMPLATE, 0, "%<>").result(binding).gsub(/^ /, '') end |