2 # -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*-
3 # vim:ts=8:sw=2:et:sta:sts=2
6 use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
9 use DistGen qw(undent);
13 # XXX DistGen shouldn't be assuming module-ness?
14 my $dist = DistGen->new(dir => MBTest->tmpdir);
15 $dist->add_file('bin/foo', undent(<<' ---'));
27 A. U. Thor, a.u.thor@a.galaxy.far.far.away
31 print "hello world\n";
35 dist_name => 'bin-foo',
36 dist_version_from => 'bin/foo',
37 dist_author => ['A. U. Thor, a.u.thor@a.galaxy.far.far.away'],
38 dist_version => '0.01',
46 $dist->change_build_pl({
47 # TODO need to get all of this data out of the program itself
48 ! $ENV{EXTRA_TEST} ? (
49 %details, meta_merge => { provides => \%meta_provides, },
51 program_name => 'bin/foo',
55 # hmm... the old assumption of what a dist looks like is wrong here
56 $dist->remove_file('lib/Simple.pm'); $dist->regen;
62 my $mb = Module::Build->new_from_context;
64 is($mb->program_name, 'bin/foo');
65 is($mb->license, 'perl');
66 is($mb->dist_name, 'bin-foo');
67 is($mb->dist_version, '0.01');
68 is_deeply($mb->dist_author,
69 ['A. U. Thor, a.u.thor@a.galaxy.far.far.away']);
70 ok $mb->dispatch('distmeta');
72 use Module::Build::ConfigData;
74 skip( 'YAML_support feature is not enabled', 1 )
75 unless Module::Build::ConfigData->feature('YAML_support');
77 my $yml = YAML::LoadFile('META.yml');
78 is_deeply($yml->{provides}, \%meta_provides);