Synesso / instinct

Automatically exported from code.google.com/p/instinct
0 stars 0 forks source link

find specifications in nested inner classes #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've had a few situations where I've wanted to group specifications in a
context together, but haven't felt that it needed to be broken into a
separate class. I think this could be handled by allowing specification
methods in (non-static?) inner classes  

eg.

public class ThingContext {
  inner class WithAFoo {
     public void shouldHaveThisSpecBeRun() {
     }
  }

  inner class WithABar {
     public void shouldPerhapsHaveDifferentExpectations() {
     }
  }
}

Some issues I've thought about:

* Before/After methods - what order should these be run in? Outside in
makes sense to me conceptually
* static/non-static classes - I think both should be supported. static
inner classes enforce that before methods from the inner class itself were run?

Original issue reported on code.google.com by nkp...@gmail.com on 5 Dec 2007 at 12:30

GoogleCodeExporter commented 9 years ago

Original comment by tomjad...@gmail.com on 15 Aug 2008 at 6:21