Is there a way to run an `around` block once for every spec *file* (not spec)? (I want to measure which files take the longest amount of time, count the number of specs in each file, and then report the average spec running time for that file.) ~ jf -- John Feminella Principal Consultant, BitsBuilder LI: http://www.linkedin.com/in/johnxf SO: http://stackoverflow.com/users/75170/
on 2011-09-07 14:14
on 2011-09-07 15:38
On Sep 7, 2011, at 6:50 AM, John Feminella wrote: > Is there a way to run an `around` block once for every spec *file* > (not spec)? Not at this point, and I don't think it would be a slam dunk to add. > (I want to measure which files take the longest amount of > time, count the number of specs in each file, and then report the > average spec running time for that file.) You can use before/after all in the outermost group: describe "thing" do before(:all) { set_up_measurements } after(:all) { report_measurements } end HTH, David
on 2011-09-07 16:08
On Wed, Sep 7, 2011 at 5:50 AM, John Feminella <johnf@bitsbuilder.com>wrote: > SO: http://stackoverflow.com/users/75170/ > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > Why not just use the --profile option?
on 2011-09-07 17:33
> Why not just use the --profile option? Doesn't --profile only return the ten slowest examples? I have thousands of specs, so I need a little more data than that. ~ jf -- John Feminella Principal Consultant, BitsBuilder LI: http://www.linkedin.com/in/johnxf SO: http://stackoverflow.com/users/75170/
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.