Re: [PATCH mirroredby.t] Tests for CPAN::Mirrored::By
Andreas König [Mon, 20 May 2002 05:36:14 +0000 (07:36 +0200)]
Message-ID: <m34rh37aoh.fsf@anima.de>

p4raw-id: //depot/perl@16703

MANIFEST
lib/CPAN/t/mirroredby.t [new file with mode: 0644]

index 576dd73..8887c40 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -985,6 +985,7 @@ lib/CPAN.pm                 Interface to Comprehensive Perl Archive Network
 lib/CPAN/FirstTime.pm          Utility for creating CPAN config files
 lib/CPAN/Nox.pm                        Runs CPAN while avoiding compiled extensions
 lib/CPAN/t/loadme.t            See if CPAN the module works
+lib/CPAN/t/mirroredby.t                See if CPAN::Mirrored::By works
 lib/CPAN/t/Nox.t               See if CPAN::Nox works
 lib/CPAN/t/vcmp.t              See if CPAN the module works
 lib/ctime.pl                   A ctime workalike
diff --git a/lib/CPAN/t/mirroredby.t b/lib/CPAN/t/mirroredby.t
new file mode 100644 (file)
index 0000000..91bd396
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+       if ($ENV{PERL_CORE}) {
+               chdir 't' if -d 't';
+               unshift @INC, '../lib';
+       }
+}
+
+use strict;
+use Test::More tests => 6; 
+
+use_ok( 'CPAN::FirstTime' );
+can_ok( 'CPAN::Mirrored::By', 'new', 'continent', 'country', 'url' );
+my $cmb = CPAN::Mirrored::By->new();
+isa_ok( $cmb, 'CPAN::Mirrored::By' );
+
+@$cmb = qw( continent country url );
+is( $cmb->continent(), 'continent',
+       'continent() should return continent entry' );
+is( $cmb->country(), 'country', 'country() should return country entry' );
+is( $cmb->url(), 'url', 'url() should return url entry' );