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.

gwgeller
  • 247
  • 1
  • 5
  • 16
  • 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 '12 at 05: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 '12 at 05:05

1 Answers1

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!!!

gwgeller
  • 247
  • 1
  • 5
  • 16