juuuser
2008-Aug-19 21:53 UTC
[rspec-users] failing before :all doesn''t move progress bar in html reports
Hello. I''ve found one bug when failing before :all block doesn''t move html report''s progress bar correctly. You can test it out easily by doing something like this: describe "bad bad bad" do before :all do true.should be_false end it "empty" do end end Now run this spec with html formatter and you should get 100% width to rspec-header div, but it has width of 0%. When you add some other describe blocks with specs then it would be something below 100%, but should be 100% if everything is finished. I''ve fixed this in my custom htmlformatter by adding these lines into example_failed method prior invoking super: def example_failed example, counter, failure #.... #some other stuff #.... if example.description == "before(:all)" @example_number +@options.example_groups[example_group_number-1].examples.size end super end If there''s any better solution, please let me know :) Best Regards, juuser. -- View this message in context: http://www.nabble.com/failing-before-%3Aall-doesn%27t-move-progress-bar-in-html-reports-tp19059450p19059450.html Sent from the rspec-users mailing list archive at Nabble.com.
MaurĂcio Linhares
2008-Aug-19 21:55 UTC
[rspec-users] failing before :all doesn''t move progress bar in html reports
Maybe you shouldn''t be placing spectations in a before or after filter, it doesn''t make much sense. On Tue, Aug 19, 2008 at 6:53 PM, juuuser <jarmo.p at gmail.com> wrote:> > Hello. > > I''ve found one bug when failing before :all block doesn''t move html > report''s > progress bar correctly. > > You can test it out easily by doing something like this: > > describe "bad bad bad" do > > before :all do > true.should be_false > end > > it "empty" do > end > > end > > Now run this spec with html formatter and you should get 100% width to > rspec-header div, but it has width of 0%. When you add some other describe > blocks with specs then it would be something below 100%, but should be 100% > if everything is finished. > > I''ve fixed this in my custom htmlformatter by adding these lines into > example_failed method prior invoking super: > > def example_failed example, counter, failure > > #.... > #some other stuff > #.... > > if example.description == "before(:all)" > @example_number +> @options.example_groups[example_group_number-1].examples.size > end > super > > end > > If there''s any better solution, please let me know :) > > Best Regards, > juuser. >-- Maur?cio Linhares http://alinhavado.wordpress.com/ (pt-br) | http://blog.codevader.com/ (en) Jo?o Pessoa, PB, +55 83 8867-7208 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080819/90774148/attachment.html>
Pat Maddox
2008-Aug-19 22:06 UTC
[rspec-users] failing before :all doesn''t move progress bar in html reports
On Tue, Aug 19, 2008 at 5:55 PM, Maur?cio Linhares <mauricio.linhares at gmail.com> wrote:> Maybe you shouldn''t be placing spectations in a before or after filter, it > doesn''t make much sense.I disagree. They can be useful for verifying assumptions about fixture data. At any rate, a bug''s a bug. juuser: can you please submit a ticket @ http://rspec.lighthouseapp.com ? Pat
juuuser
2008-Aug-19 22:11 UTC
[rspec-users] failing before :all doesn''t move progress bar in html reports
It makes sense to me. Let''s say that you want to initialize object in your before :all, but this fails. For example, in my case I''m using RSpec for automated web testing with Watir and I''m logging into web application from before :all and if this fails then it''s logical that there''s no point to execute any further specs and carry on with next describe block, but html report won''t be correct. Maur?cio Linhares-3 wrote:> > Maybe you shouldn''t be placing spectations in a before or after filter, it > doesn''t make much sense. >-- View this message in context: http://www.nabble.com/failing-before-%3Aall-doesn%27t-move-progress-bar-in-html-reports-tp19059450p19059735.html Sent from the rspec-users mailing list archive at Nabble.com.