in reply to Test::Cmd::Common and Test::More
You probably should use Test::Cmd if you want to integrate easily with Test::More and friends. In Test::Cmd::Common (to quote from the docs):
All methods throw exceptions and exit on failure
Since you want to detect failure rather than exit, use Test::Cmd instead. For example:
use strict; use warnings; use Test::More tests => 2; use Test::Cmd; my $cmd = Test::Cmd->new( prog => '/bin/ls /etc/motd' ); is $cmd->run, 0, 'ls ran okay'; is $cmd->stdout, "/etc/motd\n", 'and gave expected output';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Test::Cmd::Common and Test::More
by chromatic (Archbishop) on Jun 27, 2003 at 17:15 UTC | |
by adrianh (Chancellor) on Jun 27, 2003 at 20:19 UTC |