[rspec-users] "unit" vs. "functional" specs

Pat Maddox patmaddox at me.com
Sat Dec 18 05:59:44 EST 2010

Why don't functional specs count towards your coverage metric? It sounds like you're shooting for 100% unit test coverage -- why? If you write code in order to make your functional specs pass, then that code was TDD'd...right?


On Dec 10, 2010, at 2:29 PM, Andrew Wagner <wagner.andrew at gmail.com> wrote:

> I went back and forth on whether to send this to this list or the ruby-talk list, so feel free to tell me to take a hike...
> I'm working on a personal project where I'm trying to keep a really high bar on quality. One of the ways I'm doing that is to stick very close to the BDD/TDD cycle as suggested in the RSpec book. However, I'm actually using rspec for both the feature-level (BDD) tests and the unit-level (TDD) tests. I'm also striving for 100% test coverage using Simplecov.
> That said, I just realized that, to enforce that cycle, it's also important that I ask "do my unit tests by themselves provide 100% test coverage?". Because, otherwise, it's easy to get excited and write code to make the feature past, that isn't TDD'd.
> Anyway, all that to ask: is there some way to configure Simplecov to emit code coverage stats for just a subset of all the tests that are running? That is, I want to set up my rakefile such that it runs all my tests, but only reports on code coverage for the unit tests.
> Am I going about this with the right mindset? Any suggestions?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users

More information about the rspec-users mailing list