Permalink
Browse files

Debug refresh_list() re situation where an item in the list is not fo…

…und in the repository -- and is therefore removed from the list.
  • Loading branch information...
1 parent b89e082 commit b4c6190e112fe24220eb7e08edbbaeb43a35b92f @jkeenan committed Feb 24, 2010
Showing with 8 additions and 10 deletions.
  1. +1 −0 lib/CPAN/Mini/Visit/Simple.pm
  2. +1 −0 lib/CPAN/Mini/Visit/Simple/Auxiliary.pm
  3. +1 −2 t/001_new.t
  4. +5 −8 t/006_refresh_list.t
View
1 lib/CPAN/Mini/Visit/Simple.pm
@@ -18,6 +18,7 @@ use CPAN::Mini::Visit::Simple::Auxiliary qw(
get_lookup_table
normalize_version_number
);
+#use Data::Dumper;$Data::Dumper::Indent=1;
sub new {
my ($class, $args) = @_;
View
1 lib/CPAN/Mini/Visit/Simple/Auxiliary.pm
@@ -10,6 +10,7 @@ our @EXPORT_OK = qw(
normalize_version_number
create_minicpan_for_testing
create_one_new_distro_version
+ create_file
);
use Carp;
use File::Basename;
View
3 t/001_new.t
@@ -7,8 +7,7 @@ use Carp;
use File::Path qw( make_path );
use File::Spec;
use File::Temp qw( tempdir );
-use Test::More qw(no_plan); # tests => 5;
-use Data::Dumper;$Data::Dumper::Indent=1;
+use Test::More tests => 11;
BEGIN { use_ok( 'CPAN::Mini::Visit::Simple' ); }
View
13 t/006_refresh_list.t
@@ -7,10 +7,12 @@ use CPAN::Mini::Visit::Simple;
use CPAN::Mini::Visit::Simple::Auxiliary qw(
create_minicpan_for_testing
create_one_new_distro_version
+ create_file
);
use Carp;
use File::Spec;
-use Test::More tests => 39;
+use Test::More tests => 38;
+#use Data::Dumper;$Data::Dumper::Indent=1;
{
my ($tdir, $author_dir) = create_minicpan_for_testing();
@@ -96,13 +98,8 @@ use Test::More tests => 39;
# minicpan, it should not be included in the list generated by the
# operation of refresh_list().
- my $update = q{Eta-Theta-0.05.tar.gz};
- my $updated_file = File::Spec->catfile($author_dir, $update);
- open my $FH, '>', $updated_file
- or croak "Unable to open handle to $update for writing";
- say $FH q{};
- close $FH or croak "Unable to close handle to $update after writing";
- ok( ( -f $updated_file ), "$updated_file created" );
+ my $stray = File::Spec->catfile( $author_dir, 'Iota-Kappa-0.06.tar.gz' );
+ push @{$old_primary_list_ref}, $stray;
my $refreshed_list_ref = $self->refresh_list( {
derived_list => $old_primary_list_ref,

0 comments on commit b4c6190

Please sign in to comment.