0

This is code in a model:

  def find_tech
   Category.find_by_name("tech")
  end

and this is the rspec test:

  x = Category.find_tech
  x.name.should == "tech"

and the test passes. But rcov doesn't think so.

First of all why not ?

Second, if I do have to change something then what good is simplecov ?

cbron
  • 4,036
  • 3
  • 33
  • 40

1 Answers1

0

Did you add SimpleCov's setup to the very top (line 1) of your spec_helper as stated in the Readme?

require 'simplecov'
SimpleCov.start 'rails
TheDeadSerious
  • 842
  • 8
  • 11
  • Yup, I had spork in there too so I put it at the top of the Spork.prefork block. Neither worked. – cbron Sep 16 '11 at 18:00
  • Unfortunately Simplecov, or more precisely the underlying Coverage STDLIB has trouble with the way Spork works, which has not been resolved as of now. Please have a look at the SimpleCov github issues for more info. – TheDeadSerious Jan 25 '12 at 19:36
  • 1
    By the way, the Spork setup issue has been resolved: https://github.com/colszowka/simplecov/issues/42 – TheDeadSerious May 11 '12 at 08:54