1

I kind of have a mess going right now, but the gist is I can run rake spec:rcov successfully and get a report but all it shows as being covered is the "def" lines of my code. None of the code inside the methods is being run according to rcov.

Specifically I have a disp_price_txt method in my application helper. I have written specs, that pass in rspec, in spec/helpers/application_helper_spec.rb. However rcov is not showing the code as being run.

My gems are below. I'm using ree 1.8.7-head. I started out by installing Metrical and was going to uses simplecov until I realized it was for 1.9 only. Then I went back to rcov.

rails (3.1.1) rspec (2.8.0, 2.7.0) rspec-core (2.8.0, 2.7.1) rspec-expectations (2.8.0, 2.7.0) rspec-mocks (2.8.0, 2.7.0) rspec-rails (2.8.1, 2.7.0) rcov (0.9.11)

Hopefully this is enough to get some input. If any other info is needed let me know. Thanks.

2
  • I installed a test project and got rspec and rcov working right away. I just noticed that when I run rcov on the test project it outputs the rspec progress. However it doesn't do that on the main app. I'm running rcov directly using -Ispec spec/**/*.rb.
    – gwgeller
    Feb 16, 2012 at 5:03
  • Also all rspec gems are version 2.8.0, rspec-rails 2.8.1 and rcov is 1.0.0 for both the test project and main app.
    – gwgeller
    Feb 16, 2012 at 5:05

1 Answer 1

4

Looks like I was missing "require 'rspec/autorun'" in my spec_helper.rb. I inherited this project so I'm not sure if it was removed. My guess is the rspec gem was updated but the spec_helper.rb was from an older gem. Anyway it's solved and everything is working!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.