note
moritz
<p>There are several approaches:</p>
<ul>
<li>Make the interactive parts optional, for example accept command line arguments, and only ask interactively if command lines are missing. Simplifies testing and automation a lot.</li>
<li>Make the code an object on which it calls the <c>->readline</c> method, and only create a Term::ReadLine object in its place if no such object was passed. That makes it easy to supply a "fake" Term::ReadLine object of your own creatin in the test code (that's called "dependency injection").</li>
<li>Automate the whole thing across a process boundary with [cpan://Expect]-like modules.</li>
</ul>
<p>I'd certainly go with the first option if possible, and fall back to the second option if ithe first isn't applicable.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-616540">
[http://perl6.org/|Perl 6 - the future is here, just unevenly distributed]
</div></div>
1058721
1058721