Domanda

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.

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top