I'm using 3.0 and have created and run a few basic RSpec and Cucumber tests (just to make sure the plumbing was hooked up correctly). I think I'm having another plumbing problem and hope someone can help. (I didn't see this problem described in the Forum.)
I successfully installed the 'rcov' gem in the 'test' group in my Gemfile. I then edited the run configuration settings for my Rails Development Server and Rake 'spec' and 'cucumber' tasks.
The Dev Server works fine. When I run the app it displays the following RCov warning: ** WARNING: Ruby 1.9 Support is experimental at best. Don't expect correct results! **. When I stop the server the RCov percentages are displayed in the Project window. This leads me to believe a large portion of the plumbing is in place.
However, I can't see any results for 'spec' and 'cucumber' tests. I enabled both in the Run Config dialog box the same way I did for the Dev Server. I didn't add any patterns for Dev Server and that worked, so I assume that I don't have to add any for my test apps, i.e. I assume something like *.rb and *.haml are included by default. (Is this a correct assumption?) (Also, I tried adding *.rb as a pattern and that didn't help.)
The 'Help' says something about adding appropriate options to the Rakefile when running RSpec. That part confused me. Do I have to actually edit a Rakefile somewhere? If so, where is it? I found the Rakefile for the RSpec gem that I installed, but it doesn't have a section in it that resembled what was in the Help. So I simply added the following to the 'Task Arguments' field in the 'Configuration' tab for RSpec: "rcov_opts = ENV["RCOV_OPTS"]. I don't know if this accomplishes the same thing or not.
That might be one problem, but even if it is, it seems that the cucumber tests should work. I have enabled RCov for them in the same way, but I don't see any coverage stats. Not only do I not see any stats, but I don't see the "Show Coverage" button ( the little rake icon) in either my spec or cucumber test windows after running my tests.
Another confusing thing: When I run my spec and/or cucumber tests nothing happens RCov-wise. However, I notice that if I stop my Development Server and then run either my spec or cucumber tests a dialog box pops up when the tests finish running. It says "Do you want to display coverage data for 'cucumber Coverage results'?" (Similarly for rspec.) When I click 'yes' I don't see any stats anywhere. Then if I run the tests again I don't see that dialog box; it only pops up right after stopping my Development Server.
This is all pretty screwy, but it's probably just a result of some missing plumbing or setting.