-
Notifications
You must be signed in to change notification settings - Fork 0
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
Modulino can't be tested when using pod2usage #1
Comments
Correction: You can load the modulino and do: system 'perl', $INC{'modulino.pm'}, qw( arguments );, and use Capture::Tiny to capture the output, but that's kind of strange. Of course, that only has to be done for the error conditions, or when testing the main() sub. |
Don't you think this can or should be filed as a bug, or maybe feature request, of pod2usage? |
pod2usage already has a "don't exit" mode, but you have to explicitly enable it. There's also a way to override CORE::GLOBAL::exit, which is what App::Cmd::Tester does. But the non-CPAN (core module) slides need some way to do it. Overriding *CORE::GLOBAL::exit will work as long as it's done before the modulino (or specifically Pod::Usage) is loaded and the function is bound. Adding a package var to Pod::Usage might also work. OR, instead of calling exit() specifically, it could die with a dualvar (exit code and error message). But I'm not sure how much backwards compatibility that will affect. |
Ha. I wrote Pod::Usage::Return for exactly this reason! I should update the modulino bit to mention it. |
pod2usage calls "exit()", we need some test boilerplate to fix that problem
The text was updated successfully, but these errors were encountered: