failing before :all doesn't move progress bar in html reports
Reported by juuser | August 20th, 2008 @ 12:30 AM | in No-Milestone-Assigned
When before :all block raises an exception, then html report's progress bar is updated incorrectly.
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 overriding example_failed method by these few lines 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
It's not 100% foolproof though - for example if someone has some very strange need to do something like this:
it "before(:all)" do
#this block fails and progress bar is set as 100%.
end
Comments and changes to this ticket
-

juuser August 20th, 2008 @ 12:30 AM
- → Assigned user changed from to Pat Maddox
-

juuser August 20th, 2008 @ 12:59 AM
fixed this minor fool-proof thing like this:
if example.description == "before(:all)" and not example.instance_variable_defined?(:@_matcher_description)
@example_number += @options.example_groups[example_group_number-1].examples.size endsince it's quite minor bug, maybe something like this is all what's needed? :P
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Behaviour Driven Development for Ruby.
