Skip to content
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

Add reference to ExpectedException. Fixes #806. #808

Merged
merged 1 commit into from
Feb 4, 2014

Conversation

stefanbirkner
Copy link
Contributor

The ExpectedException can be used for better exception testing. The
reference should guide the reader to its documentation.

@stefanbirkner
Copy link
Contributor Author

@junit-team As an alternative we could write something like

It is recommend to use ExpectedException instead of the expected parameter. ExpectedException supports more detailed exception testing.

* </pre></p>
* </pre>
* If the exception's message or one of its properties should be verified, the
* {@link org.junit.rules.ExpectedException} can be used.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you either add the word "rule" before the word "can", or remove the word "the" at the end of the previous line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@kcooney
Copy link
Member

kcooney commented Jan 29, 2014

@stefanbirkner I think your current wording is fine. I am not sure if we want to have the Javadoc tell people to prefer ExpectedException. If you'd like, you could add a link to the Javadoc that goes to a page that discusses testing for exceptions in detail.

The ExpectedException can be used for better exception testing. The
reference should guide the reader to its documentation.
@stefanbirkner
Copy link
Contributor Author

@kcooney I added the reference to the JUnit Wiki and removed the recommendation for ExpectedException.

kcooney added a commit that referenced this pull request Feb 4, 2014
Add reference to ExpectedException. Fixes #806.
@kcooney kcooney merged commit 274041d into junit-team:master Feb 4, 2014
@stefanbirkner stefanbirkner deleted the exception-testing branch February 4, 2014 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants