[rspec-users] RSpec 0.7.5 with Rails and rcov

aslak hellesoy aslak.hellesoy at gmail.com
Fri Jan 5 06:01:32 EST 2007


In the next release (or rspec+spec/rails on trunk) you'll also be able
to leave the built-in spec:* tasks by editing a spec/spec.opts file.

On 1/5/07, Jonathan Tron <jonathan.tron.mailings at gmail.com> wrote:
> Le 5 janv. 07 à 03:05, Bryan Liles a écrit :
>
> > I seem to be missing something because I am at a loss on how to get
> > rcov, RSpec, and Rails working together.  Would someone mind dropping
> > some hints?
>
> I don't know what you want to achieve, but if your goal is to
> generate some reports here's what I added to lib/tasks/
> rspec_additions.rake :
>
> namespace :spec do
>    desc "Spec with rspec/rcov reports"
>    Spec::Rake::SpecTask.new('reports') do |t|
>      t.spec_files = FileList['spec/**/*.rb']
>      t.spec_opts = ["--format", "html", "--diff"]
>      t.out = 'doc/rspec.html'
>      t.rcov = true
>      t.rcov_dir = 'doc/coverage'
>
> # Optional :
> # Prevent rcov to generate report on specs, environment.rb and boot.rb
> #    t.rcov_opts = ['--exclude', 'spec,config\/environment.rb,config\/
> boot.rb']
>
>      t.fail_on_error = false
>      t.failure_message = "The specs failed. Check for the problem at
> http://projects.tron.name/flash007/rspec.html"
>    end
> end
>
> Run it with rake : spec:reports
> It will generate rspec.html report in doc/rspec.html and rcov report
> in doc/coverage/.
>
> Jonathan
> --
> Tron Jonathan
> http://jonathan.tron.name
>
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list