Module: Overseer::Duties
- Included in:
- Overseer
- Defined in:
- lib/overseer/duties.rb
Instance Attribute Summary collapse
-
#current_suite ⇒ Object
readonly
Returns the value of attribute current_suite.
-
#current_test ⇒ Object
Returns the value of attribute current_test.
Instance Method Summary collapse
- #build_after(&block) ⇒ Object
- #build_before(&block) ⇒ Object
- #build_suite(suite) ⇒ Object
- #build_test(name, &block) ⇒ Object
- #errors_exists? ⇒ Boolean
- #failures_exists? ⇒ Boolean
- #suites ⇒ Object
- #total_assertions ⇒ Object
- #total_errors ⇒ Object
- #total_failures ⇒ Object
- #total_tests ⇒ Object
- #total_time ⇒ Object
Instance Attribute Details
#current_suite ⇒ Object (readonly)
Returns the value of attribute current_suite.
3 4 5 |
# File 'lib/overseer/duties.rb', line 3 def current_suite @current_suite end |
#current_test ⇒ Object
Returns the value of attribute current_test.
4 5 6 |
# File 'lib/overseer/duties.rb', line 4 def current_test @current_test end |
Instance Method Details
#build_after(&block) ⇒ Object
19 20 21 |
# File 'lib/overseer/duties.rb', line 19 def build_after(&block) @current_suite.after = block end |
#build_before(&block) ⇒ Object
15 16 17 |
# File 'lib/overseer/duties.rb', line 15 def build_before(&block) @current_suite.before = block end |
#build_suite(suite) ⇒ Object
10 11 12 13 |
# File 'lib/overseer/duties.rb', line 10 def build_suite(suite) @current_suite = Suite.new(suite) suites << @current_suite end |
#build_test(name, &block) ⇒ Object
6 7 8 |
# File 'lib/overseer/duties.rb', line 6 def build_test(name, &block) @current_suite.tests << Test.new(name, &block) end |
#errors_exists? ⇒ Boolean
31 32 33 |
# File 'lib/overseer/duties.rb', line 31 def errors_exists? total_errors > 0 end |
#failures_exists? ⇒ Boolean
27 28 29 |
# File 'lib/overseer/duties.rb', line 27 def failures_exists? total_failures > 0 end |
#suites ⇒ Object
23 24 25 |
# File 'lib/overseer/duties.rb', line 23 def suites @suites ||= [] end |
#total_assertions ⇒ Object
35 36 37 |
# File 'lib/overseer/duties.rb', line 35 def total_assertions suites.inject(0) { |total, suite| total + suite.total_test_assertions } end |
#total_errors ⇒ Object
43 44 45 |
# File 'lib/overseer/duties.rb', line 43 def total_errors suites.inject(0) { |total, suite| total + suite.total_test_errors } end |
#total_failures ⇒ Object
39 40 41 |
# File 'lib/overseer/duties.rb', line 39 def total_failures suites.inject(0) { |total, suite| total + suite.total_test_failures } end |
#total_tests ⇒ Object
47 48 49 |
# File 'lib/overseer/duties.rb', line 47 def total_tests suites.inject(0) { |total, suite| total + suite.tests.size } end |
#total_time ⇒ Object
51 52 53 |
# File 'lib/overseer/duties.rb', line 51 def total_time suites.inject(0) { |total, suite| total + suite.total_test_time } end |