Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
/ simplecov-rcov-text Public archive

SimpleCov formatter to generate a simple rcov.txt Rcov style

Notifications You must be signed in to change notification settings

kina/simplecov-rcov-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simplecov Rcov Formatter Text

The target of this formatter is to cheat on metric_fu so it’s possible to use simplecov instead rcov.

Install

gem install simplecov-rcov-text

Usage

Add the gem to the Gemfile preferably in the group test:

gem 'simplecov', :require => false
gem 'simplecov-rcov-text', :require => false

Create a .metrics file in the root of project with the code:

MetricFu::Configuration.run do |config|
  config.rcov[:external] = 'coverage/rcov/rcov.txt'
end

And follow the instructions of Simplecov and metric_fu or metrical.

Simplest way

require 'simplecov'
require 'simplecov-rcov-text'
SimpleCov.formatter = SimpleCov::Formatter::RcovTextFormatter

Using with HTML Format

require 'simplecov'
require 'simplecov-rcov-text'
class SimpleCov::Formatter::MergedFormatter
  def format(result)
     SimpleCov::Formatter::HTMLFormatter.new.format(result)
     SimpleCov::Formatter::RcovTextFormatter.new.format(result)
  end
end
SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter

Running metric_fu/metrical

Be sure that you configured simplecov and simplecov-rcov-text.

Run your test framework, example:

rspec spec

After that you can run the metric_fu/metrical command.

Don’t forget to configure .metrics file!


Example of generated file

metric_fu shift the first line
   class SomeClass
     def method_1
       1+1
     end

     def method_2 ( value )
!!     value * value
     end
   end

Running tests

bundle
rake

About

SimpleCov formatter to generate a simple rcov.txt Rcov style

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages