/[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 90 - (show annotations) (download) (as text)
Wed Aug 2 01:27:42 2006 UTC (8 years, 8 months ago) by mcummings
File MIME type: text/troff
File size: 1590 byte(s)
Last commit for 0.14.0. 


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 if ( $> > 0 )
29 {
30 plan skip_all => 'Root needed for these tests, sorry';
31 }
32 else
33 {
34 plan tests => 7;
35 }
36 }
37
38 use strict;
39 use warnings;
40
41 my $module = "Module::Build";
42
43 # Verify we can load Gentoo name space
44 BEGIN { use_ok(' Gentoo'); }
45
46 # Can we call new?
47 my $GC = Gentoo->new();
48 ok( defined($GC), 'new() works' );
49
50
51 # Can we get the PORTDIR value?
52 ok( $GC->getValue("PORTDIR"), 'getValue("PORTDIR") worked' );
53
54 $GC->getCPANInfo($module);
55 # Test getting the contents of a directory
56 ok( $GC->{cpan}, 'Information for $module obtained' );
57 ok($GC->{cpan}{lc($module)}{'version'}, '$module has version');
58 ok($GC->{cpan}{lc($module)}{'name'}, '$module has a name');
59 ok($GC->{cpan}{lc($module)}{'src_uri'}, '$module has src_uri');
60 ok($GC->{cpan}{lc($module)}{'description'}, '$module has a description');
61
62 #MPC $GC->debug;

  ViewVC Help
Powered by ViewVC 1.1.20