[rspec-users] Display Rspec output in an html file

Amit Kulkarni lists at ruby-forum.com
Tue Nov 10 07:37:44 EST 2009


I checked the whole code but there is no error as such.
What i have done is i added a line i.e.
t.spec_opts = ['--format' , 'html:result.html' ] under 
/lib/tasks/rspec.rake i.e.
[:models, :controllers, :views, :helpers, :lib, :integration].each do 
|sub|
    desc "Run the code examples in spec/#{sub}"
    Spec::Rake::SpecTask.new(sub => spec_prereq) do |t|
      t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
      t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
      t.spec_opts = ['--format' , 'html:result.html' ]
    end
  end

After adding i am running the rake tasks as rake spec:models 
RAILS_ENV=test

But it is giving me error as posted above.

Also is there is any other way to print output in an html file bu using 
above rake command?
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list