Class: SimpleCov::Formatter::SimpleFormatter

### Home Classes Methods

### In Files

- lib/simplecov/formatter/simple_formatter.rb

### Parent

Object

### Methods

- #format

### Class/Module Index

Quicksearch

- SimpleCov
- SimpleCov::Adapters
- SimpleCov::ArrayMergeHelper
- SimpleCov::BlockFilter
- SimpleCov::CommandGuesser
- SimpleCov::Configuration
- SimpleCov::CoverageDataError
- SimpleCov::ExitCodes
- SimpleCov::FileList
- SimpleCov::Filter
- SimpleCov::Formatter
- SimpleCov::Formatter::MultiFormatter
- SimpleCov::Formatter::SimpleFormatter
- SimpleCov::HashMergeHelper
- SimpleCov::JSON
- SimpleCov::LastRun
- SimpleCov::Railtie
- SimpleCov::Result
- SimpleCov::ResultMerger
- SimpleCov::SourceFile
- SimpleCov::SourceFile::Line
- SimpleCov::StringFilter

No matching classes.

# SimpleCov::Formatter::SimpleFormatter

A ridiculously simple formatter for SimpleCov results.

### Public Instance Methods

format(result) click to toggle source

Takes a SimpleCov::Result and generates a string out of it

    # File lib/simplecov/formatter/simple_formatter.rb, line 6
    def format(result)
      output = ""
      result.groups.each do |name, files|
        output << "Group: #{name}\n"
        output << "="*40
        output << "\n"
        files.each do |file|
          output << "#{file.filename} (coverage: #{file.covered_percent.round(2)}%)\n"
        end
        output << "\n"
      end
      output
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.