New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared Examples #13

Open
andreareginato opened this Issue Oct 3, 2012 · 4 comments

Comments

Projects
None yet
5 participants
@andreareginato
Collaborator

andreareginato commented Oct 3, 2012

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

@dgm

This comment has been minimized.

Show comment
Hide comment
@dgm

dgm 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.

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.

@cupakromer

This comment has been minimized.

Show comment
Hide comment
@cupakromer

cupakromer Nov 6, 2012

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 https://www.relishapp.com/rspec/rspec-core/v/2-11/docs/example-groups/shared-examples for examples of this.

cupakromer commented Nov 6, 2012

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 https://www.relishapp.com/rspec/rspec-core/v/2-11/docs/example-groups/shared-examples for examples of this.

@gavingmiller

This comment has been minimized.

Show comment
Hide comment
@gavingmiller

gavingmiller Jan 10, 2014

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

gavingmiller commented Jan 10, 2014

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

@iRet

This comment has been minimized.

Show comment
Hide comment
@iRet

iRet Sep 18, 2014

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

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