Shared Examples #13

andreareginato opened this Issue Oct 3, 2012 · 4 comments


None yet

5 participants


Write your thoughts about the "shared examples" best practice.

dgm commented Oct 7, 2012

Doesn't this violate the one assertion per test principal? ;) FWIW, I agree with this practices, but just goes to show that the other rule is more of a guideline.


I don't believe it violates the 'one assertion rule' by definition. It will depend entirely on how you define your shared example. The intent is to group behavior, so it can include multiple single assertion cases. See for examples of this.


The GOOD example is missing the actual shared examples, so this code doesn't make sense unless someone knows how shared examples work.

iRet commented Sep 18, 2014

@gavingmiller absolutely right. Shared examples definition part is missing. It is confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment