Class: Overseer::Suite
- Inherits:
-
Object
- Object
- Overseer::Suite
- Defined in:
- lib/overseer/suite.rb
Instance Attribute Summary collapse
-
#after ⇒ Object
Returns the value of attribute after.
-
#before ⇒ Object
Returns the value of attribute before.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#tests ⇒ Object
All tests for the suite.
Instance Method Summary collapse
-
#initialize(suite) ⇒ Suite
constructor
A new instance of Suite.
-
#run ⇒ Object
Run all tests and print a report for each run about the success status.
-
#total_test_assertions ⇒ Object
The total amount of assertions.
-
#total_test_errors ⇒ Object
The total amount of errors.
-
#total_test_failures ⇒ Object
The total amount of failures.
-
#total_test_time ⇒ Object
The total test running time.
Constructor Details
#initialize(suite) ⇒ Suite
Returns a new instance of Suite.
6 7 8 |
# File 'lib/overseer/suite.rb', line 6 def initialize(suite) @name = suite.name end |
Instance Attribute Details
#after ⇒ Object
Returns the value of attribute after.
3 4 5 |
# File 'lib/overseer/suite.rb', line 3 def after @after end |
#before ⇒ Object
Returns the value of attribute before.
3 4 5 |
# File 'lib/overseer/suite.rb', line 3 def before @before end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/overseer/suite.rb', line 4 def name @name end |
#tests ⇒ Object
All tests for the suite
46 47 48 |
# File 'lib/overseer/suite.rb', line 46 def tests @tests end |
Instance Method Details
#run ⇒ Object
Run all tests and print a report for each run about the success status
13 14 15 16 17 18 |
# File 'lib/overseer/suite.rb', line 13 def run tests.each do |test| test.run Reporter.print_single_test_result(test) end end |
#total_test_assertions ⇒ Object
The total amount of assertions
40 41 42 |
# File 'lib/overseer/suite.rb', line 40 def total_test_assertions tests.inject(0) { |total, test | total + test.assertions } end |
#total_test_errors ⇒ Object
The total amount of errors
22 23 24 |
# File 'lib/overseer/suite.rb', line 22 def total_test_errors tests.inject(0) { |total, test | total + test.errors.size } end |
#total_test_failures ⇒ Object
The total amount of failures
28 29 30 |
# File 'lib/overseer/suite.rb', line 28 def total_test_failures tests.inject(0) { |total, test | total + test.failures.size } end |
#total_test_time ⇒ Object
The total test running time
34 35 36 |
# File 'lib/overseer/suite.rb', line 34 def total_test_time tests.inject(0) { |total, test| total + test.time } end |