Giter VIP home page Giter VIP logo

simplecov-rcov-text's Introduction

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

simplecov-rcov-text's People

Contributors

kina avatar rodrigues avatar

Watchers

Gianfranco Zas avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.