seratch / scalatest

Automatically exported from code.google.com/p/scalatest
Apache License 2.0
0 stars 0 forks source link

Handle scala.NotImplementedError in a sexier way #25

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write a test
2. Use ??? in your model
3. Run the tests

What is the expected output? What do you see instead?

What I would like to see: A clean indication that the tests are exercising a 
part of the model that is not yet implemented.

What I see: An ugly stack trace that is rarely of any use, stops other tests 
from running and pollutes the output.

What version of the product are you using? On what operating system?

version 2.0.M5b on Fedora 18 VirtualBox running on OS X 10.6.8

Please provide any additional information below.

An example project demonstrating the problem: 
https://github.com/jedesah/tournament

Original issue reported on code.google.com by jeanremi...@gmail.com on 19 Feb 2013 at 9:24

GoogleCodeExporter commented 8 years ago
This is a very nice issue report. Love having a github project that illustrates 
the issue. The issue is, though, that ScalaTest really can't move forward if a 
Suite fails to construct. In a FeatureSpec, feature clauses are evaluated at 
construction time. Only scenario clauses are evaluated later, when run is 
invoked on the FeatureSpec instance. So any exceptions, including 
NotImplementedErrors, thrown from feature clauses will indeed abort the run. 
What I think you meant to do was put a scenario inside that feature that is 
blowing up, because you have Given/When/Then's in there. If not, that's the 
intended way to use FeatureSpec. Possibly you could rename feature to scenario 
as the fix. I'll submit a pull request later today on your project, but that's 
the issue. What I think might be nice is if I could print out a hint that this 
is the problem when this happens. It is an easy thing for users to try.

Original comment by billvenn...@gmail.com on 26 Feb 2013 at 6:30