class Rote::RCovTask

Rake task library that allows code-coverage reports to be generated using RCov (eigenclass.org/hiki.rb?rcov).

Attributes

excludes[RW]

Set of glob patterns that should be excluded from the test run. [none]

failonerror[RW]

If false, the task will emit a warning rather than failing when Rcov command fails. [true]

load_paths[RW]

Extra load-paths that should be appended to $: when running the test cases. [none]

no_color[RW]

If true, RCov will generate colorblind-safe output. [false]

output_dir[RW]

The path to which RCov should generate output [./coverage]

profile[RW]

Determines whether bogo-profiling is enabled [false]

range[RW]

The color scale range for profiling output (dB) [not used]

rcov_cmd[RW]

The command that runs RCov [‘rcov’]

source_files[RW]

A +Rake::FileList+ holding Ruby source filenames that are included in the coverage report. This is optional - RCov finds sources by running them. However, if you do specify your files here then the coverage report will only be generated when they change.

taskname[R]

The base name for the generated task [:rcov]

test_files[RW]

A +Rake::FileList+ holding unit-test filenames and globs. RCov will execute these to generate the report.

Public Class Methods

new(name = :rcov, failonerror = true) { |self| ... } click to toggle source

Create a new RCovTask, using the supplied block for configuration, and define tasks with the specified base-name within Rake.

Note that the named task just invokes a file task for the output directory, which is dependent on test (and source, if specified) file changes.

# File lib/rote/extratasks.rb, line 61
def initialize(name = :rcov, failonerror = true) # :yield: self if block_given?      
  @taskname = name
  @rcov_cmd = 'rcov'
  @test_files = Rake::FileList.new
  @source_files = Rake::FileList.new
  @load_paths = []
  @excludes = []      
  @output_dir = './coverage'
  @failonerror = true
  
  yield self if block_given?

  define(name)
end