mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unit Tests
- Removed useless setup/teardown tests, improving the signal to noise ratio.
This commit is contained in:
parent
f85ff7bde1
commit
fb11379630
4 changed files with 4 additions and 33 deletions
|
@ -27,7 +27,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 4;
|
||||
use Test::More tests => 2;
|
||||
|
||||
# Ensure environment has no influence.
|
||||
delete $ENV{'TASKDATA'};
|
||||
|
@ -39,7 +39,6 @@ if (open my $fh, '>', 'obsolete.rc')
|
|||
print $fh "data.location=.\n",
|
||||
"foo=1\n";
|
||||
close $fh;
|
||||
ok (-r 'obsolete.rc', 'Created obsolete.rc');
|
||||
}
|
||||
|
||||
# Test the add command.
|
||||
|
@ -51,11 +50,5 @@ like ($output, qr/ foo\n/, 'unsupported configuration variable');
|
|||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data obsolete.rc);
|
||||
ok (! -r 'pending.data' &&
|
||||
! -r 'completed.data' &&
|
||||
! -r 'undo.data' &&
|
||||
! -r 'backlog.data' &&
|
||||
! -r 'obsolete.rc', 'Cleanup');
|
||||
|
||||
exit 0;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 24;
|
||||
use Test::More tests => 22;
|
||||
|
||||
# Ensure environment has no influence.
|
||||
delete $ENV{'TASKDATA'};
|
||||
|
@ -39,7 +39,6 @@ if (open my $fh, '>', 'confirm.rc')
|
|||
print $fh "data.location=.\n",
|
||||
"confirmation=yes\n";
|
||||
close $fh;
|
||||
ok (-r 'confirm.rc', 'Created confirm.rc');
|
||||
}
|
||||
|
||||
# Create the response file.
|
||||
|
@ -100,12 +99,5 @@ like ($output, qr/(Permanently delete task 7 'foo'\? \(yes\/no\)) \1 \1/, 'confi
|
|||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data confirm.rc response.txt);
|
||||
ok (! -r 'pending.data' &&
|
||||
! -r 'completed.data' &&
|
||||
! -r 'undo.data' &&
|
||||
! -r 'backlog.data' &&
|
||||
! -r 'confirm.rc' &&
|
||||
! -r 'response.txt', 'Cleanup');
|
||||
|
||||
exit 0;
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
use strict;
|
||||
use warnings;
|
||||
use POSIX qw(mktime);
|
||||
use Test::More tests => 7;
|
||||
use Test::More tests => 5;
|
||||
|
||||
# Ensure environment has no influence.
|
||||
delete $ENV{'TASKDATA'};
|
||||
|
@ -40,7 +40,6 @@ if (open my $fh, '>', 'count.rc')
|
|||
print $fh "data.location=.\n",
|
||||
"confirmation=off\n";
|
||||
close $fh;
|
||||
ok (-r 'count.rc', 'Created count.rc');
|
||||
}
|
||||
|
||||
# Test the count command.
|
||||
|
@ -85,11 +84,5 @@ TODO: {
|
|||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data count.rc);
|
||||
ok (! -r 'pending.data' &&
|
||||
! -r 'completed.data' &&
|
||||
! -r 'undo.data' &&
|
||||
! -r 'backlog.data' &&
|
||||
! -r 'count.rc', 'Cleanup');
|
||||
|
||||
exit 0;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Test::More tests => 82;
|
||||
use Test::More tests => 80;
|
||||
|
||||
# Ensure environment has no influence.
|
||||
delete $ENV{'TASKDATA'};
|
||||
|
@ -62,7 +62,6 @@ if (open my $fh, '>', 'countdown.rc')
|
|||
print $fh "report.downc.sort=due-\n";
|
||||
|
||||
close $fh;
|
||||
ok (-r 'countdown.rc', 'Created countdown.rc');
|
||||
}
|
||||
|
||||
# Create a variety of pending tasks with increasingly higher due dates
|
||||
|
@ -179,10 +178,4 @@ like ($output, qr/\btwo\b.+\bone\b/ms, 'downc: two < one');
|
|||
|
||||
# Cleanup.
|
||||
unlink qw(pending.data completed.data undo.data backlog.data countdown.rc);
|
||||
ok (! -r 'pending.data' &&
|
||||
! -r 'completed.data' &&
|
||||
! -r 'undo.data' &&
|
||||
! -r 'backlog.data' &&
|
||||
! -r 'countdown.rc', 'Cleanup');
|
||||
|
||||
exit 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue