Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Rename Test:Class tests to prevent needlessly re-running the same sub…

…tests over and over
  • Loading branch information...
commit 24ebdecd58393b4ea197ff19b74f335fc6fed4ac 1 parent 4e8cc41
@sanko authored
View
26 t/10000_by_class/Net/BitTorrent/Torrent/Generator.t
@@ -33,7 +33,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator;
explain 'Metadata now looks like...', $s->{'torrent'};
}
- sub api_comment : Test( 4 ) {
+ sub _200_api : Test( 7 ) {
my $s = shift;
is $s->{'torrent'}->comment, undef, 'default comment is undef';
ok !$s->{'torrent'}->_has_comment, '_has_comment is false';
@@ -41,8 +41,6 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator;
'_set_comment( ... )';
is $s->{'torrent'}->comment, 'See credit.txt for attributions.',
'comment is correct';
- }
- {
sub _files {
['./t/90000_data/96000_data/96020_miniswarm_seed/1291672777_30adc6a421_o.jpg',
@@ -50,19 +48,15 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator;
'./t/90000_data/96000_data/96020_miniswarm_seed/credit.txt'
];
}
-
- sub api___files : Test( 3 ) {
- my $s = shift;
- is_deeply $s->{'torrent'}->files, $s->_files,
- 'list of files is correct';
- is $s->{'torrent'}->_count_files, scalar(@{$s->_files}),
- '_count_files is correct';
- {
- my $expected;
- for my $file (@{$s->_files}) { $expected += -s $file }
- is $s->{'torrent'}->total_size, $expected,
- 'total_size is correct'
- }
+ is_deeply $s->{'torrent'}->files, $s->_files,
+ 'list of files is correct';
+ is $s->{'torrent'}->_count_files, scalar(@{$s->_files}),
+ '_count_files is correct';
+ {
+ my $expected;
+ for my $file (@{$s->_files}) { $expected += -s $file }
+ is $s->{'torrent'}->total_size, $expected,
+ 'total_size is correct'
}
}
View
2  t/10000_by_class/Net/BitTorrent/Torrent/Generator_piece_length.t
@@ -15,7 +15,7 @@ package t::10000_by_class::Net::BitTorrent::Torrent::Generator_piece_length;
't::10000_by_class::Net::BitTorrent::Torrent::Generator_multiple_files';
$|++;
- sub t_020_piece_length : Test( 8 ) {
+ sub _200_api : Test( 8 ) {
my $s = shift;
is $s->{'torrent'}->piece_length, 262144,
'default piece_length (2**18)';
Please sign in to comment.
Something went wrong with that request. Please try again.