Class: Rubotium::TestSuite
- Inherits:
-
Object
- Object
- Rubotium::TestSuite
- Defined in:
- lib/rubotium/test_results.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #each_test ⇒ Object
- #error_count ⇒ Object
- #failures_count ⇒ Object
-
#initialize(name, test_cases) ⇒ TestSuite
constructor
A new instance of TestSuite.
- #passed_count ⇒ Object
- #state ⇒ Object
- #tests_count ⇒ Object
- #time ⇒ Object
Constructor Details
#initialize(name, test_cases) ⇒ TestSuite
Returns a new instance of TestSuite.
75 76 77 78 |
# File 'lib/rubotium/test_results.rb', line 75 def initialize(name, test_cases) @name = name @test_cases = test_cases end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
73 74 75 |
# File 'lib/rubotium/test_results.rb', line 73 def name @name end |
Instance Method Details
#each_test ⇒ Object
104 105 106 107 108 |
# File 'lib/rubotium/test_results.rb', line 104 def each_test test_cases.each{|test_case| yield(test_case) } end |
#error_count ⇒ Object
84 85 86 |
# File 'lib/rubotium/test_results.rb', line 84 def error_count @errors ||= count_by(:errored?).to_i end |
#failures_count ⇒ Object
80 81 82 |
# File 'lib/rubotium/test_results.rb', line 80 def failures_count @failures ||= count_by(:failed?).to_i end |
#passed_count ⇒ Object
88 89 90 |
# File 'lib/rubotium/test_results.rb', line 88 def passed_count @passed_count ||= count_by(:passed?).to_i end |
#state ⇒ Object
92 93 94 |
# File 'lib/rubotium/test_results.rb', line 92 def state return (failures_count + error_count > 0) ? 'failed' : 'passed' end |
#tests_count ⇒ Object
100 101 102 |
# File 'lib/rubotium/test_results.rb', line 100 def tests_count @tests_count ||= test_cases.count end |
#time ⇒ Object
96 97 98 |
# File 'lib/rubotium/test_results.rb', line 96 def time @time ||= sum_of(:time) end |