How call a method/something after ALL specs?

hi, is there a way to call a method/print something after ALL the
specs are run ? (with all, i mean all, after all the spec files, just
before the rspec output which say how many spec have passed)…

i want to print some text telling which is the average response time
and which is the action which takes more time

I’ve tried with the ruby at_exit method, but it puts the result 3
times, any hint?

On Fri, Jan 8, 2010 at 7:24 AM, mix [email protected] wrote:

hi, is there a way to call a method/print something after ALL the
specs are run ? (with all, i mean all, after all the spec files, just
before the rspec output which say how many spec have passed)…

i want to print some text telling which is the average response time
and which is the action which takes more time

I’ve tried with the ruby at_exit method, but it puts the result 3
times, any hint?

Best bet is probably a custom formatter. I’d make a subclass of the
formatter you want to use, for example
Spec::runner::Formatter::ProgressBarFormatter, and override the
dump_summary
method (which is defined in Spec::runner::Formatter::BaseTextFormatter).

Then you can say:

spec spec --formatter <path/to/your/custom/formatter>

HTH,
David