ExtUtils::MakeMaker 6.55_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / metafile_data.t
index 597e448..29d271c 100644 (file)
@@ -9,14 +9,14 @@ BEGIN {
 }
 
 use strict;
-use Test::More tests => 3;
+use Test::More tests => 7;
 
 use Data::Dumper;
 
 require ExtUtils::MM_Any;
 
 my $new_mm = sub {
-    return bless {@_}, 'ExtUtils::MM_Any';
+    return bless { ARGS => {@_}, @_ }, 'ExtUtils::MM_Any';
 };
 
 {
@@ -39,6 +39,9 @@ my $new_mm = sub {
         configure_requires      => {
             'ExtUtils::MakeMaker'       => 0,
         },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
 
         no_index        => {
             directory           => [qw(t inc)],
@@ -63,6 +66,9 @@ my $new_mm = sub {
         configure_requires      => {
             'ExtUtils::MakeMaker'       => 0,
         },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
 
         no_index        => {
             directory           => [qw(t inc foo)],
@@ -113,6 +119,10 @@ my $new_mm = sub {
         configure_requires      => {
             Stuff       => 2.34,
         },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+
         requires       => {
             Foo                 => 2.34,
             Bar                 => 4.56,
@@ -133,3 +143,173 @@ my $new_mm = sub {
         wobble  => 42,
     ];
 }
+
+
+# Test MIN_PERL_VERSION
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+        MIN_PERL_VERSION => 5.006,
+    );
+
+    is_deeply [$mm->metafile_data], [
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => undef,
+        author          => [],
+        license         => 'unknown',
+        distribution_type       => 'module',
+
+        configure_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+
+        requires        => {
+            perl        => '5.006',
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html', 
+            version     => 1.4
+        },
+    ];
+}
+
+
+# Test MIN_PERL_VERSION
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+        MIN_PERL_VERSION => 5.006,
+        PREREQ_PM => {
+            'Foo::Bar'  => 1.23,
+        },
+    );
+
+    is_deeply [$mm->metafile_data], [
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => undef,
+        author          => [],
+        license         => 'unknown',
+        distribution_type       => 'module',
+
+        configure_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+
+        requires        => {
+            perl        => '5.006',
+            'Foo::Bar'  => 1.23,
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html', 
+            version     => 1.4
+        },
+    ];
+}
+
+# Test CONFIGURE_REQUIRES
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        CONFIGURE_REQUIRES => {
+            "Fake::Module1" => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+    );
+
+    is_deeply [$mm->metafile_data], [
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => undef,
+        author          => [],
+        license         => 'unknown',
+        distribution_type       => 'module',
+
+        configure_requires      => {
+            'Fake::Module1'       => 1.01,
+        },
+        build_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html', 
+            version     => 1.4
+        },
+    ],'CONFIGURE_REQUIRES';
+}
+
+# Test BUILD_REQUIRES
+{
+    my $mm = $new_mm->(
+        DISTNAME        => 'Foo-Bar',
+        VERSION         => 1.23,
+        BUILD_REQUIRES => {
+            "Fake::Module1" => 1.01,
+        },
+        PM              => {
+            "Foo::Bar"          => 'lib/Foo/Bar.pm',
+        },
+    );
+
+    is_deeply [$mm->metafile_data], [
+        name            => 'Foo-Bar',
+        version         => 1.23,
+        abstract        => undef,
+        author          => [],
+        license         => 'unknown',
+        distribution_type       => 'module',
+
+        configure_requires      => {
+            'ExtUtils::MakeMaker'       => 0,
+        },
+        build_requires      => {
+            'Fake::Module1'       => 1.01,
+        },
+
+        no_index        => {
+            directory           => [qw(t inc)],
+        },
+
+        generated_by => "ExtUtils::MakeMaker version $ExtUtils::MakeMaker::VERSION",
+        'meta-spec'  => {
+            url         => 'http://module-build.sourceforge.net/META-spec-v1.4.html', 
+            version     => 1.4
+        },
+    ],'CONFIGURE_REQUIRES';
+}