[rspec-users] RCov results seem to include the spec files

Pat Maddox pergesu at gmail.com
Mon Apr 9 13:14:29 EDT 2007


On 4/9/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> On 4/9/07, David Chelimsky <dchelimsky at gmail.com> wrote:
> > 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
>
> FYI - I added this to docs for 0.9.
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>

Hey David,

Thanks for the info.

For Rails apps, I use
t.rcov_opts = ['--exclude', "spec", "--exclude", "config"]

because it doesn't make much sense to include the config files either.

Thanks again,

Pat


More information about the rspec-users mailing list