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?
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
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 >
> 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/.This results in a bus error in OSX 10.4.8 (I had a similar task that did the same thing): <snip path>/config/../vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb:13: [BUG] Bus Error ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1] I''m running Rails 1.2 in vendor/rails Anyone else getting this? Any idea why? Thanks. Matt> > Jonathan > -- > Tron Jonathan > http://jonathan.tron.name >
I''m running the same system configuration as you, except my Rails install is 5623. The bus error does not occur on my system when running this task. Note: I''m running trunk rSpec. What version of rSpec did you say you were running? --steve On Jan 14, 2007, at 9:04 PM, Matt Pelletier 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/. > > This results in a bus error in OSX 10.4.8 (I had a similar task that > did the same thing): > > <snip path>/config/../vendor/rails/activerecord/lib/active_record/ > associations/has_many_association.rb:13: > [BUG] Bus Error > ruby 1.8.5 (2006-08-25) [i686-darwin8.8.1] > > I''m running Rails 1.2 in vendor/rails > > Anyone else getting this? Any idea why? Thanks. > > Matt > >> >> Jonathan >> -- >> Tron Jonathan >> http://jonathan.tron.name >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Le 16 janv. 07 ? 00:55, s.ross a ?crit :> I''m running the same system configuration as you, except my Rails > install is 5623. The bus error does not occur on my system when > running this task. Note: I''m running trunk rSpec. What version of > rSpec did you say you were running?As I said on a different thread, I had the problem of "Bus Error" too, but only when I''m using mock_model from (http://metaclass.org/ 2006/12/22/making-a-mockery-of-activerecord). I run specs on two different config and only the local one segfault. My local config is : MacOS X.4.8 / Ruby 1.8.5 (from MacPorts) / Rails edge 1.2-branch / RSpec 0.7.5 (gem) / RspecOnRails 0.7.5 (from trunk at 1331) / rcov 0.7.0.1 (gem) My remote config is : Debian Testing / Ruby 1.8.5-4 / Rails edge 1.2- branch / RSpec 0.7.5 (gem) / RspecOnRails 0.7.5 (from trunk at 1331) / rcov 0.7.0.1 (gem) Jonathan -- Tron Jonathan http://jonathan.tron.name
Is anyone telling Mauricio about this? We''re not going to fix it - bus error is a ruby/rcov problem Aslak On 1/16/07, Jonathan Tron <jonathan.tron.mailings at gmail.com> wrote:> Le 16 janv. 07 ? 00:55, s.ross a ?crit : > > > I''m running the same system configuration as you, except my Rails > > install is 5623. The bus error does not occur on my system when > > running this task. Note: I''m running trunk rSpec. What version of > > rSpec did you say you were running? > > As I said on a different thread, I had the problem of "Bus Error" > too, but only when I''m using mock_model from (http://metaclass.org/ > 2006/12/22/making-a-mockery-of-activerecord). I run specs on two > different config and only the local one segfault. > > My local config is : MacOS X.4.8 / Ruby 1.8.5 (from MacPorts) / Rails > edge 1.2-branch / RSpec 0.7.5 (gem) / RspecOnRails 0.7.5 (from > trunk at 1331) / rcov 0.7.0.1 (gem) > My remote config is : Debian Testing / Ruby 1.8.5-4 / Rails edge 1.2- > branch / RSpec 0.7.5 (gem) / RspecOnRails 0.7.5 (from trunk at 1331) / > rcov 0.7.0.1 (gem) > > > Jonathan > -- > Tron Jonathan > http://jonathan.tron.name > > > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >