Class: Turn::Controller

### Home Classes Methods

### In Files

- lib/turn/controller.rb

### Parent

Object

### Methods

- ::new
- #runner
- #setup
- #start

### 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::Controller

Controls execution of test run.

### Attributes

config[R]

### Public Class Methods

new(config=Turn.config) click to toggle source

    # File lib/turn/controller.rb, line 8
    def initialize(config=Turn.config)
      @config = config
    end

### Public Instance Methods

runner() click to toggle source

Insatance of Runner, selected based on format and runmode.

    # File lib/turn/controller.rb, line 36
    def runner
      @runner ||= (
        require 'turn/runners/minirunner'

        case config.runmode
        when :marshal
          Turn::MiniRunner
        when :solo
          require 'turn/runners/solorunner'
          Turn::SoloRunner
        when :cross
          require 'turn/runners/crossrunner'
          Turn::CrossRunner
        else
          Turn::MiniRunner
        end
      )
    end

setup() click to toggle source

    # File lib/turn/controller.rb, line 29
    def setup
      config.loadpath.each{ |path| $: << path } unless config.live?
      config.requires.each{ |path| require(path) }
      config.files.each{ |path| require(path) }
    end

start() click to toggle source

    # File lib/turn/controller.rb, line 16
    def start
      if config.files.empty?
        $stderr.puts "No tests."
        return
      end

      setup

      testrun = runner.new
      testrun.start
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.