Undercover is a new Ruby gem for code coverage

Undercover is a new Ruby gem for code coverage
Average rating: 2
(2 votes)

Thanks! You’ve rated this material!

When you hear the word Ruby, what is the first thing that comes to your mind? Some of its advantages? Or the list of projects that were developed using Ruby? For us, Ruby is the language of choice, so we can’t be indifferent when we’ve got something new to tell you. Undercover is a new Ruby gem for code coverage that we eager to show you in this article.

Undercover inspects files in and warns on methods, classes, and blocks that we need to test coverage.

That’s what you need to do first:

  • Add this line to your application’s Gemfile:
gem 'undercover'
  • Then execute:
$ bundle
  • Or install it as:
$ gem install undercover

To make your specs or tests compatible with undercover by providing an LCOV report, please add simplecov and simplecov-lcov to your test setup.

The aim was to create a tool to help others ensure that tests are written for all the recent code changes. This works for any ruby project, but especially big codebases that lack testing.

The goal was to provide automated warnings, that are:

  • relevant, so scoped to the actual code changes
  • timely, so we don’t write tests long after the implementation
  • actionable, so we can fix them before the code is committed

For more background, please here.

P.S.Take the advantage of another interesting tool – StringScanner Ruby gem provides lexical scanning operations on a string. Do you want to find even out more? Don’t hesitate to check our latest Rails digest with the most interesting and promising Ruby gems!

Rate this article, if you like it

Thanks! You’ve rated this material!

Got a project? Let's discuss it!

*By submitting this form you agree with our Privacy Policy.

Mailing & Legal Address

Syndicode Inc. 340 S Lemon Ave #3299, Walnut CA, 91789, USA

Visiting & Headquarters address
Kyiv Sofiivska 1/2a, 01001, Kyiv, Ukraine
Dnipro Hlinky 2, of. 1003, 49000, Dnipro, Ukraine
Email info@syndicode.com
Phone (+1) 9035021111