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

Discourage use_ok in the docs. #288

Closed
schwern opened this issue Apr 23, 2012 · 2 comments
Closed

Discourage use_ok in the docs. #288

schwern opened this issue Apr 23, 2012 · 2 comments

Comments

@schwern
Copy link
Contributor

schwern commented Apr 23, 2012

use_ok is generally considered harmful, or at least unnecessary, if all is required is to load a module in a test. A simple use will work fine and will stop the test if it fails rather than trying to push on.

  • Remove recommendations for use_ok just to load a module in the docs
  • Recommend require_ok if a series of modules need to be loaded
@pdl
Copy link
Contributor

pdl commented Apr 23, 2012

#287 mentions that lexical effects were an addition. Test::More.pm currently states:

Lexical effects will occur as usual.  For example, this will turn on strictures.

  BEGIN { use_ok "strict"; }

However, these lines are not present in 0.98. Should these also be removed as part of this issue (or as part of #287?)

@schwern
Copy link
Contributor Author

schwern commented Apr 24, 2012

They should be removed as part of #287 which removes the lexical effect functionality. If it's easier to blur #287 and #288 that's fine.

schwern added a commit that referenced this issue Apr 26, 2012
Rather than write a whole bunch of docs about why use_ok() is evil and
clutter things up for new developers, require_ok() has been emphesized.

* The main docs have been moved to require_ok()
* require_ok() comes first
* use_ok() is gone from the SYNOPSIS
* Various misuses of use_ok() are mentioned
* The "Module Tests" blurb doesn't give bad advice

For #288
schwern added a commit that referenced this issue Apr 26, 2012
@schwern schwern closed this as completed May 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants