开发者

Confused about simplecov and rspec in rails

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 ?


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜