Class: RSpec::LogSplit::Handler

### Home Classes Methods

### In Files

- lib/rspec/log_split/handler.rb

### Parent

Object

### Methods

- ::new
- #description
- #error
- #run

### Class/Module Index

Quicksearch

- RSpec
- RSpec::LogSplit
- RSpec::LogSplit::Config
- RSpec::LogSplit::Handler

No matching classes.

# RSpec::LogSplit::Handler

### Public Class Methods

new(logger, mod, example, example_logger) click to toggle source

    # File lib/rspec/log_split/handler.rb, line 4
    def initialize(logger, mod, example, example_logger)
      @logger = logger
      @mod = mod
      @example = example
      @example_logger = example_logger
    end

### Public Instance Methods

description() click to toggle source

    # File lib/rspec/log_split/handler.rb, line 25
    def description
      @example.full_description
    end

error(message) click to toggle source

    # File lib/rspec/log_split/handler.rb, line 29
    def error(message)
      @logger.error message
      @mod.logger.error message
    end

run() click to toggle source

    # File lib/rspec/log_split/handler.rb, line 11
    def run
      @mod.logger = @example_logger
      begin
        error "starting #{description}"
        @example.run
      rescue Exception => e
        error "error with #{description}: #{e.inspect}"
        raise e
      ensure
        error "finishing #{description}"
        @mod.logger = nil
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.