Simplecov with Spork? #30

Closed
neezer opened this Issue Mar 20, 2011 · 14 comments

Projects

None yet

9 participants

@neezer

Is there anyway to make simplecov work with spork? I can only seem to get test coverage results when I don't have spork running...

https://github.com/timcharper/spork

@dre3k

Works fine for me.

Gemfile:
gem 'simplecov', '>= 0.4.2', :require => false, :group => :test
spec_helper.rb:
Spork.each_run do
# This code will be run each time you run your specs.
require 'simplecov'
SimpleCov.start 'rails'
# ...
end

@neezer

So it does. My bad.

@neezer neezer closed this Apr 4, 2011
@masonicboom

I get "0 / 0 LOC (0.0%) covered." with that method, dre3k. Any idea why that would happen? I'll dig in when I have a chance, but any leads would help. Do you not get that 0/0 LOC covered, neezer?

@neezer

@masonicboom - nope, I get normal coverage reports (no error) using what dre3k had written.

@masonicboom
@jeffshantz

@masonicboom: Did you ever figure out the 0/0 LOC issue? I'm getting this as well. Thanks.

@Esteth

@masonicboom: Also getting this issue with 0/0 LOC

@Esteth

Solved: The issue for me was that I had cache-classes enabled in my testing environment config. This means simplecov can't inspect loads of files, since they're all done in the application.initialize! call.

@masonicboom

I can't remember if I ever solved this for myself; might've just run simplecov w/o spork until i got close enough to 100%, then stopped using it

@jeffshantz

@esteth: Hmm.. tried that and no dice. @masonicboom: Yeah, it's not a huge deal to have Spork automatically run Simplecov. Think I'll file it under "would be nice" and just run it manually, in the interest of time.

@pupeno

I'm having a similar issue, no data generated, without using spork, and setting config.cache_classes to false made it generate some data.

@heaven

Same issue, 0 / 0 LOC (0.0%) covered, cache classes is set to false

@kevindavis

Per @Esteth's reply, I changed the cache classes line to false in /config/test.rb and simplecov started working

@zxiest

@kevindavis 's solution fixes it for me! Thank you, Kevin :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment