/[gentoo-perl]/g-cpan/trunk/t/10cpan_packages.t
Gentoo

Contents of /g-cpan/trunk/t/10cpan_packages.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 54 - (show annotations) (download) (as text)
Wed May 10 16:15:56 2006 UTC (8 years, 4 months ago) by mcummings
File MIME type: text/troff
File size: 1555 byte(s)
Moved Ebuild.pm to Portage.pm
1 #
2 #===============================================================================
3 #
4 # FILE: 10cpan_packages.t
5 #
6 # DESCRIPTION: Test Gentoo::CPAN Functionality
7 #
8 # FILES: ---
9 # BUGS: ---
10 # NOTES: ---
11 # AUTHOR: Michael Cummings (), <mcummings@gentoo.org>
12 # COMPANY: Gentoo
13 # VERSION: 1.0
14 # CREATED: 05/09/06 14:36:47 EDT
15 # REVISION: ---
16 #===============================================================================
17
18 eval 'use CPAN::Config;';
19 my $needs_cpan_stub = $@ ? 1 : 0;
20 use Test::More;
21
22 if ( ( ($needs_cpan_stub) || ( $> > 0 ) )
23 && ( !-f "$ENV{HOME}/.cpan/CPAN/MyConfig.pm" ) )
24 {
25 plan skip_all => 'Tests impossible without a configured CPAN::Config';
26 }
27 else {
28 plan qw(no_plan);
29 }
30
31 use strict;
32 use warnings;
33
34 # Verify we can load Gentoo name space
35 BEGIN { use_ok(' Gentoo'); }
36
37 # Can we call new?
38 my $GC = Gentoo->new();
39 ok( defined($GC), 'new() works' );
40
41
42 # Can we get the PORTDIR value?
43 ok( $GC->getValue("PORTDIR"), 'getValue("PORTDIR") worked' );
44
45 $GC->getCPANPackages();
46 # Test getting the contents of a directory
47 ok( $GC->{modules}, 'Digested available versions' );
48 ok( $GC->{modules}{cpan}, 'Portage_lc check' );
49 ok( $GC->{modules}{cpan_lc}, 'Digested available versions' );
50 foreach my $mod (keys %{$GC->{moduels}{cpan}} ) {
51 ok($mod, '$mod has value');
52 ok($GC->{modules}{cpan}{$mod}, '$mod has version');
53 }
54 foreach my $mod (keys %{$GC->{modules}{cpan_lc}} ) {
55 ok($mod, '$mod has value');
56 ok($GC->{modules}{cpan_lc}{$mod}, "$mod name check");
57 }
58
59 #MPC $GC->debug;

  ViewVC Help
Powered by ViewVC 1.1.20