lkdjiin / coco

Code coverage for ruby 2.x
http://lkdjiin.github.com/coco/
MIT License
70 stars 12 forks source link

Coco output difference when running `rake` and `rspec spec` #20

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi, I've noticed an issue with Coco's coverage metrics, specifically with Rails 4 and Rspec 2.

When I run rspec spec I get the coverage report I'd expect. When I run rake spec I get a lot of 0% coverage on files that have 100% coverage when I run the former command.

Anyone else experiencing this phenomenon?

lkdjiin commented 11 years ago

Hi BigNerdRanchDan, thanks for the report. I will check this issue ASAP.

lkdjiin commented 11 years ago

I can't reproduce this issue. I have never used rake spec before and I can't use it right now: all my projects crash with this command due to some issues with the database (postgres). Could you give me more clues? Where exactly do you put the require 'coco' line?

ghost commented 11 years ago

Hi @lkdjiin, I was able to resolve it. The issue was the I'm using Bundler with RVM, so I just had to modify it to not require automatically:

group :test do
  gem 'coco', require: false
end

Now that I have that in my Gemfile (and require 'coco' in spec_helper.rb), the output is the same between rake spec and rspec spec.

lkdjiin commented 11 years ago

Cool, thank you for the tip.