I am in the midst of refactoring a large application into several modules, on the theory that it will make it easier to package the application for use in different places if it is modularized.
One of the modules provides a frontend to Net::Telnet::Cisco to slurp up various tables from routers and switches. To do so it must log in to each router or switch using its telnet and enable passwords.
My question is: given the fact that it is problematic to do anything that prompts the user in a t/*.t script, and it is even more problematic to ask for the user to put passwords on the command line or in the environment (which in "make test" is often done from the command line anyway), how can I test these modules at all?
Net::Telnet::Cisco itself seems to get around the issue by using only a test.pl script (which doesn't have the same issues as a t/*.t script WRT the test harness eating the prompt). Can a given module use *both* test.pl and t/*.t?
As you can probably tell, I'm new to the Monastery and fairly new at writing modules as opposed to scripts. Any assistance will be appreciated. Thanks.
In reply to Module testing using passwords by bigmacbear
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |