Update of /cvsroot/module-build/Module-Build/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26483/t
Modified Files:
extend.t
Log Message:
add meta_add and meta_merge mechanisms
Index: extend.t
===================================================================
RCS file: /cvsroot/module-build/Module-Build/t/extend.t,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- extend.t 10 Apr 2005 03:58:35 -0000 1.11
+++ extend.t 10 Apr 2005 17:46:46 -0000 1.12
@@ -2,7 +2,7 @@
# Tests various ways to extend Module::Build, e.g. by subclassing.
-use Test::More tests => 45;
+use Test::More tests => 50;
use Module::Build;
ok 1;
@@ -145,3 +145,28 @@
can_ok $build, 'bar';
is $build->bar, 'yow';
}
+
+{
+ # Test the meta_add and meta_merge stuff
+ chdir $goto;
+ ok my $build = Module::Build->new(
+ module_name => 'Sample',
+ meta_add => {foo => 'bar'},
+ conflicts => {'Foo::Barxx' => 0},
+ );
+ my %data;
+ $build->prepare_metadata( \%data );
+ is $data{foo}, 'bar';
+
+ $build->meta_merge(foo => 'baz');
+ $build->prepare_metadata( \%data );
+ is $data{foo}, 'baz';
+
+ $build->meta_merge(conflicts => {'Foo::Fooxx' => 0});
+ $build->prepare_metadata( \%data );
+ is_deeply $data{conflicts}, {'Foo::Barxx' => 0, 'Foo::Fooxx' => 0};
+
+ $build->meta_add(conflicts => {'Foo::Bazxx' => 0});
+ $build->prepare_metadata( \%data );
+ is_deeply $data{conflicts}, {'Foo::Bazxx' => 0, 'Foo::Fooxx' => 0};
+}
|