schwern/test-more — pull request #370 by schwern (2013-04-23 15:39:36+00:00)
Title: Allow store_events to be switched on/off after events have been seen

These patches allow `TB2::History->store_events` to be turned on and off after events have been seen. Previously once TB2::History had seen an event it would not allow a switch. This was to protect the user from getting only a partial event list.

No longer storing events is turning out to be an incompatibility problem. Most cases can use the TB2::History statistics methods, but a few cases need the event list. This makes it much easier to turn events on. It's now C<< Test::Builder->history->store_events(1) >> rather than having to grab the state object before any events are run.

The Test::Builder docs have been updated to reflect this change, point the user at the statistics methods instead, and show how to turn event storage on.

This satisfies #315. Now that it can be switched on and off later there's no need to add wrapper methods to Test::Builder. I'd rather people got used to working directly with the history object.