Class: Turn::TestSuite

### Home Classes Methods

### In Files

- lib/turn/components/suite.rb

### Parent

Object

### Methods

- ::new
- #count_assertions
- #count_errors
- #count_failures
- #count_passes
- #count_skips
- #count_tests
- #counts
- #each
- #new_case
- #passed?
- #size
- #size=

### Included Modules

- Enumerable

### Files

- History.txt
- LICENSE.txt
- Release.txt
- Version.txt

### Class/Module Index

Quicksearch

- Turn
- Turn::Colorize
- Turn::Command
- Turn::Configuration
- Turn::Controller
- Turn::CrossRunner
- Turn::CueReporter
- Turn::DotReporter
- Turn::IsoRunner
- Turn::MarshalReporter
- Turn::MiniRunner
- Turn::OutlineReporter
- Turn::PrettyReporter
- Turn::ProgressReporter
- Turn::Reporter
- Turn::SoloRunner
- Turn::TestCase
- Turn::TestMethod
- Turn::TestRunner
- Turn::TestSuite
- Turn::ToptenDecorator
- Test
- Test::Unit
- Test::Unit::Failure
- Object
- String

No matching classes.

# Turn::TestSuite

### Attributes

cases[RW]
count_assertions[W]

This one can be set manually since it is not calculatable (beyond the case level).

name[RW]
seed[RW]

### Public Class Methods

new(name=nil) click to toggle source

    # File lib/turn/components/suite.rb, line 17
    def initialize(name=nil)
      @name  = name
      @cases = []
      @size  = nil
      @seed  = nil

      #@count_tests      = nil
      #@count_assertions = nil
      #@count_failures   = nil
      #@count_errors     = nil
      #@count_passes     = nil
    end

### Public Instance Methods

count_assertions() click to toggle source

    # File lib/turn/components/suite.rb, line 43
    def count_assertions
      #@count_assertions ||= (
        sum = 0; each{ |c| sum += c.count_assertions }; sum
      #)
    end

count_errors() click to toggle source

    # File lib/turn/components/suite.rb, line 55
    def count_errors
      #@count_errors ||= (
        sum = 0; each{ |c| sum += c.count_errors }; sum
      #)
    end

count_failures() click to toggle source

    # File lib/turn/components/suite.rb, line 49
    def count_failures
      #@count_failures ||= (
        sum = 0; each{ |c| sum += c.count_failures }; sum
      #)
    end

count_passes() click to toggle source

    # File lib/turn/components/suite.rb, line 61
    def count_passes
      #@count_passes ||= (
        sum = 0; each{ |c| sum += c.count_passes }; sum
      #)
    end

count_skips() click to toggle source

    # File lib/turn/components/suite.rb, line 67
    def count_skips
      sum = 0; each{ |c| sum += c.count_skips }; sum
    end

count_tests() click to toggle source

    # File lib/turn/components/suite.rb, line 37
    def count_tests
      #@count_tests ||= (
        sum = 0; each{ |c| sum += c.count_tests }; sum
      #)
    end

counts() click to toggle source

Convenience methods --this is what is typcially wanted.

    # File lib/turn/components/suite.rb, line 72
    def counts
      return count_tests, count_assertions, count_failures, count_errors ,count_skips
    end

each(&block) click to toggle source

    # File lib/turn/components/suite.rb, line 76
    def each(&block)
      @cases.each(&block)
    end

new_case(name, *files) click to toggle source

    # File lib/turn/components/suite.rb, line 31
    def new_case(name, *files)
      c = TestCase.new(name, *files)
      @cases << c
      c
    end

passed?() click to toggle source

    # File lib/turn/components/suite.rb, line 89
    def passed?
      (count_failures == 0 && count_errors == 0)
    end

size() click to toggle source

    # File lib/turn/components/suite.rb, line 80
    def size
      @size ||= @cases.size
    end

size=(number) click to toggle source

Why the size would ever have to overridden... well who can say.

    # File lib/turn/components/suite.rb, line 85
    def size=(number)
      @size = number.to_i
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.