in reply to Guidelines for creating self-contained testable scripts

What about the obvious..

use Test::more qw(2); sub it_worked { # check to see if myscript worked # EG, did it update file X by adding line Y } ok( !system('./bin/myscript'), "didn't blow chunks"); ok( it_worked,'it worked');

Replies are listed 'Best First'.
Re^2: Guidelines for creating self-contained testable scripts
by jdrago_999 (Hermit) on Aug 12, 2009 at 21:24 UTC
    That's what I would do.
Re^2: Guidelines for creating self-contained testable scripts
by rpetre (Sexton) on Aug 13, 2009 at 09:11 UTC

    That's easy, but the core of the script might do some things I wouldn't want to run while testing (like deleting files or dropping database tables or whatever), that's why I was trying to provide a way to test only specific parts.

    But yeah, you're right too :), thanks.