Open GoogleCodeExporter opened 8 years ago
This sounds like it may be more a job for withFixture rather than
BeforeAndAfterEach, but I'd like to know more about your use case. Can you
describe in more detail what you'd like to accomplish with the onError
information?
Original comment by b...@artima.com
on 31 Dec 2012 at 5:25
We have a specialized log appender for testing purposes that buffers all log
events and only writes them to stdout when a test fails, this helps keep the
build log clean unless something breaks.
Original comment by shai.yal...@gmail.com
on 31 Dec 2012 at 7:46
Sounds reasonable, but does sound like a good use case for overriding
withFixture. Are you aware of withFixture? If so, is there some reason you want
to use BeforeAndAfterEach instead? If not, you can read up on it here:
http://www.artima.com/docs-scalatest-2.0.M5/org/scalatest/FlatSpec.html#withFixt
ureNoArgTest
And here:
http://www.artima.com/docs-scalatest-2.0.M5/org/scalatest/FlatSpec.html#withFixt
ureOneArgTest
If the test function results in an exception, that's a failed test. You can
catch it, write to the log, then rethrow it.
Original comment by b...@artima.com
on 31 Dec 2012 at 7:55
Fair enough. I just thought it might be useful to have a hook method for that :)
Original comment by shai.yal...@gmail.com
on 31 Dec 2012 at 9:28
Original issue reported on code.google.com by
shai.yal...@gmail.com
on 30 Dec 2012 at 1:03