Class: Overseer::Suite

Inherits:
Object
  • Object
show all
Defined in:
lib/overseer/suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#afterObject

Returns the value of attribute after.



3
4
5
# File 'lib/overseer/suite.rb', line 3

def after
  @after
end

#beforeObject

Returns the value of attribute before.



3
4
5
# File 'lib/overseer/suite.rb', line 3

def before
  @before
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/overseer/suite.rb', line 4

def name
  @name
end

#testsObject

All tests for the suite



46
47
48
# File 'lib/overseer/suite.rb', line 46

def tests
  @tests
end

Instance Method Details

#runObject

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_assertionsObject

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_errorsObject

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_failuresObject

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_timeObject

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