views:

184

answers:

2

When I use "rake stats" I can get to know how many lines of code I have written for my RSpec tests. And my RSpec tests influences also the Code to Test Ratio.

But can I list my lines of code from the Cucumber steps there, too?

Best regards

+1  A: 

One cucumber step can do an awful lot of work, I don't think adding it to your code/test ratio would actually make sense. What information is it giving you? What if you are executing multiple dependent steps?

Cucumber tests are integration tests, they are not a replacement for controller/unit tests, but are to be done in conjunction with them.

You might be more interested in the resulting code coverage obtained by your cucumber tests, this will be a far more useful metric.

jonnii
I agree. Code to Test Ratio is a fun metric but it's not necessarily the most useful. Unless you have a strong need for it, you're better off looking at things like your overall code coverage and the like.
Peter Wagenet
A: 

See this post. It's as simple as adding two lines of code to rspec.rake file.

Lenart