Tell RCov to Cov Off - No Fluff Just Stuff

Tell RCov to Cov Off

Posted by: Aaron Bedra on October 16, 2009

Tell RCov to Cov Off

16 Oct 2009

Chad and I just released a new version of RCov! This version offers the ability to tell RCov to ignore certain pieces of code. This is useful if you are experiencing an bug in RCov, or if you just plain old disagree with RCov about the coverage status of a particular chunk of code. Here’s an example of implementation:

class Foo
  def bar
    1 + 2
  end

  #:nocov:
  def quux
    "s" + "hit"
  end
  #:nocov:

end

require 'test/unit'
class FooTest < Test::Unit::TestCase
  def test_bar
    assert_equal 3, Foo.new.bar
  end
end

Running this will show you 100% code coverage. This feature (for now) is pretty simple and does not do anything more than tell RCov to count the code as covered. If this feature takes off, I will spend more time making it smarter about the code and reporting so that you can easily tell the difference.

Aaron Bedra

About Aaron Bedra

Aaron Bedra is a Senior Engineer at DRW, where he works at the intersection trading and technology. He has served as a Chief Security Officer, Chief Technology Officer, and Principal Engineer/Architect. He has worked professionally on programming languages, most notably Clojure and ClojureScript. Aaron is the creator of Repsheet, an open source threat intelligence toolkit. He is the co-author of Programming Clojure, 2nd and 3rd Edition and a contributor to Functional Programming: A PragPub Anthology.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »