Re: [perl #46011] [RESOLVED] overload "0+" doesn't handle integer results
[p5sagit/p5-mst-13.2.git] / lib / CPANPLUS / t / 21_CPANPLUS-Dist-No-Build.t
CommitLineData
6aaee015 1### make sure we can find our conf.pl file
2BEGIN {
3 use FindBin;
4 require "$FindBin::Bin/inc/conf.pl";
5}
6
7use strict;
8use Test::More 'no_plan';
9
10use CPANPLUS::Dist;
11use CPANPLUS::Backend;
12use CPANPLUS::Module::Fake;
13use CPANPLUS::Module::Author::Fake;
14use CPANPLUS::Internals::Constants;
15
16my $Conf = gimme_conf();
17my $CB = CPANPLUS::Backend->new( $Conf );
18
19### set the config so that we will ignore the build installer,
20### but prefer it anyway
21{ CPANPLUS::Dist->_ignore_dist_types( INSTALLER_BUILD );
22 $Conf->set_conf( prefer_makefile => 0 );
23}
24
25my $Mod = $CB->module_tree( 'Foo::Bar::MB::NOXS' );
26
27ok( $Mod, "Module object retrieved" );
28ok( not grep { $_ eq INSTALLER_BUILD } CPANPLUS::Dist->dist_types,
29 " Build installer not returned" );
30
31### fetch the file first
32{ my $where = $Mod->fetch;
33 ok( -e $where, " Tarball '$where' exists" );
34}
35
36### extract it, silence warnings/messages
983ffab6 37{ my $where = $Mod->extract;
6aaee015 38 ok( -e $where, " Tarball extracted to '$where'" );
39}
40
41### check the installer type
42{ is( $Mod->status->installer_type, INSTALLER_MM,
43 "Proper installer type found" );
44
45 my $err = CPANPLUS::Error->stack_as_string;
46 like( $err, '/'.INSTALLER_MM.'/',
47 " Error mentions " . INSTALLER_MM );
48 like( $err, '/'.INSTALLER_BUILD.'/',
49 " Error mentions " . INSTALLER_BUILD );
50 like( $err, qr/but might not be able to install/,
51 " Error mentions install warning" );
52}
53
54END { 1 while unlink output_file() }