Fix random failures in CPANPLUS tests on Win32
[p5sagit/p5-mst-13.2.git] / lib / CPANPLUS / t / 03_CPANPLUS-Internals-Source.t
1 ### make sure we can find our conf.pl file
2 BEGIN { 
3     use FindBin; 
4     require "$FindBin::Bin/inc/conf.pl";
5 }
6
7 use strict;
8
9 use CPANPLUS::Backend;
10
11 use Test::More 'no_plan';
12 use Data::Dumper;
13
14 my $conf = gimme_conf();
15
16 my $cb = CPANPLUS::Backend->new( $conf );
17 isa_ok($cb, "CPANPLUS::Internals" );
18
19 my $mt      = $cb->_module_tree;
20 my $at      = $cb->_author_tree;
21 my $modname = TEST_CONF_MODULE;
22
23 for my $name (qw[auth mod dslip] ) {
24     my $file = File::Spec->catfile( 
25                         $conf->get_conf('base'),
26                         $conf->_get_source($name)
27                 );            
28     ok( (-e $file && -f _ && -s _), "$file exists" );
29 }    
30
31 ok( scalar keys %$at, "Authortree loaded successfully" );
32 ok( scalar keys %$mt, "Moduletree loaded successfully" );
33
34 my $auth    = $at->{'EUNOXS'};
35 my $mod     = $mt->{$modname};
36
37 isa_ok( $auth, 'CPANPLUS::Module::Author' );
38 isa_ok( $mod,  'CPANPLUS::Module' );
39
40 # Local variables:
41 # c-indentation-style: bsd
42 # c-basic-offset: 4
43 # indent-tabs-mode: nil
44 # End:
45 # vim: expandtab shiftwidth=4: