Skip to content
Browse files

Added tests

  • Loading branch information...
1 parent 7cb5de0 commit c722e6b54cdb7ddab5e6619fdb17173280ca482c @bingos committed May 15, 2011
Showing with 33 additions and 2 deletions.
  1. +2 −2 dist.ini
  2. +31 −0 t/01-releases.t
View
4 dist.ini
@@ -6,8 +6,8 @@ copyright_holder = Chris Williams
[@BINGOS]
-[Prereq / BuildRequires]
+[Prereqs / BuildRequires]
Test::More = 0.47
-[Prereq]
+[Prereqs]
perl = v5.6.0
View
31 t/01-releases.t
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+use Test::More qw[no_plan];
+use CPAN::Perl::Releases qw[perl_tarballs];
+
+my $perl = '5.14.0';
+
+my $expected = {
+ "tar.bz2" => "J/JE/JESSE/perl-5.14.0.tar.bz2",
+ "tar.gz" => "J/JE/JESSE/perl-5.14.0.tar.gz"
+};
+
+{
+ my $got = perl_tarballs( $perl );
+ is_deeply( $got, $expected, 'Imported function' );
+}
+
+{
+ my $got = CPAN::Perl::Releases::perl_tarballs( $perl );
+ is_deeply( $got, $expected, 'Package Function' );
+}
+
+{
+ my $got = CPAN::Perl::Releases->perl_tarballs( $perl );
+ is_deeply( $got, $expected, 'Class method' );
+}
+
+{
+ my $got = perl_tarballs( '6.0.0' );
+ ok( !$got, 'Should not have this release' );
+}

0 comments on commit c722e6b

Please sign in to comment.
Something went wrong with that request. Please try again.