Unit Tests
- More robust tests strategy: captured outputs are always compared to some expected result. - Clearer and more consistent test. Signed-off-by: Paul Beckingham <paul@beckingham.net>
This commit is contained in:
committed by
Paul Beckingham
parent
ee7fd7add0
commit
a0d6b3198e
@@ -28,7 +28,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 6;
|
||||
use Test::More tests => 8;
|
||||
|
||||
# Create the rc file.
|
||||
if (open my $fh, '>', 'bug.rc')
|
||||
@@ -41,10 +41,12 @@ if (open my $fh, '>', 'bug.rc')
|
||||
# Bug 668: URL should allow users with dot character
|
||||
|
||||
my $output = qx{../src/task rc:bug.rc merge user.name\@taskwarrior.org:undo.data 2>&1};
|
||||
like ($output, qr/^Could not run ssh. Is it installed, and available in \$PATH\?$/m, 'ssh does not connect');
|
||||
unlike ($output, qr/not a valid modifier/, 'scp syntax with dots');
|
||||
unlike ($output, qr/not in the expected format/, 'scp syntax with dots');
|
||||
|
||||
$output = qx{../src/task rc:bug.rc merge ssh://user.name\@taskwarrior.org/undo.data 2>&1};
|
||||
like ($output, qr/^Could not run ssh. Is it installed, and available in \$PATH\?$/m, 'ssh does not connect');
|
||||
unlike ($output, qr/not a valid modifier/, 'standard syntax with dots');
|
||||
unlike ($output, qr/not in the expected format/, 'standard syntax with dots');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user