[rspec-users] RCov results seem to include the spec files
David Chelimsky
dchelimsky at gmail.com
Mon Apr 9 07:14:10 EDT 2007
On 4/9/07, Pat Maddox <pergesu at gmail.com> wrote:
> I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and
> decided to add it to my project. My rakefile looks like this:
>
> require "rake"
> require "spec/rake/spectask"
>
> desc "Run all specs with RCov"
> Spec::Rake::SpecTask.new("spec:rcov") do |t|
> t.spec_files = FileList["spec/**/*_spec.rb"]
> t.rcov = true
> end
Try this:
Spec::Rake::SpecTask.new("spec:rcov") do |t|
t.spec_files = FileList["spec/**/*_spec.rb"]
t.rcov = true
t.rcov_opts = ['--exclude', "spec"]
end
David
> When I run rake spec:rcov, it runs the specs using RCov and generates
> the reports, but it's including all my spec files as well.
>
> At the very bottom I'll see stuff like
> spec/models/user_spec.rb 89 73 100.0%
>
> it even includes spec_helper.rb!
>
> I don't really care to know that my specs are covered :)
>
> Here's the command that's being run as a result of the rake task:
> /usr/local/bin/ruby
> -I"/usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/lib" -S rcov
> --exclude lib\/spec,bin\/spec,config\/boot.rb -o "coverage"
> "/usr/local/lib/ruby/gems/1.8/gems/rspec-0.8.2/bin/spec" --
> "spec/controllers/books_controller_spec.rb"
> "spec/controllers/feedback_controller_spec.rb"
> "spec/controllers/stack_controller_spec.rb"
> "spec/controllers/users_controller_spec.rb"
> "spec/helpers/books_helper_spec.rb" "spec/models/book_spec.rb"
> "spec/models/user_spec.rb"
>
> rspec 0.8.2, rcov 0.8.0.2
>
> I noticed that the example output at
> http://rspec.rubyforge.org/coverage/index.html doesn't seem to share
> this. So how can I make rcov ignore the spec files themselves?
>
> Pat
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
More information about the rspec-users
mailing list