Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure SimpleCov to ignore #inspect methods

Tags:

simplecov

My coverage report is not at 100% because I have a couple of #inspect methods in my classes which I use for debugging purposes. Is there a way to configure SimpleCov to ignore all the inspect methods?

like image 998
Omar Rodríguez Avatar asked Nov 22 '13 15:11

Omar Rodríguez


1 Answers

I know I'm late to this, but I had to do the same thing and discovered the solution.

Wrap your code with # :nocov: comments like so:

# :nocov:
def my_debug_method
  do_something
end
# :nocov:

Documentation here: http://rubydoc.info/gems/simplecov/SimpleCov/Configuration#nocov_token-instance_method

like image 181
Marc Greenstock Avatar answered Oct 23 '22 03:10

Marc Greenstock