1use strict; 2use warnings; 3 4use Test::More; 5use Test::DZil; 6use Test::Fatal; 7 8{ 9 package Dist::Zilla::PluginBundle::Bunk; 10 use Moose; 11 with 'Dist::Zilla::Role::PluginBundle::Easy'; 12 sub configure { 13 my $self = shift; 14 $self->add_plugins('DoesNotExist'); 15 } 16} 17 18like( 19 exception { 20 Builder->from_config( 21 { dist_root => 't/does-not-exist' }, 22 { 23 add_files => { 24 'source/dist.ini' => simple_ini( 25 'DoesNotExist', 26 ), 27 }, 28 }, 29 ); 30 }, 31 qr/Required plugin Dist::Zilla::Plugin::DoesNotExist isn't installed\.\n\n/, 32 'missing plugin is detected properly', 33); 34 35like( 36 exception { 37 Builder->from_config( 38 { dist_root => 't/does-not-exist' }, 39 { 40 add_files => { 41 'source/dist.ini' => simple_ini( 42 '@DoesNotExist', 43 ), 44 }, 45 }, 46 ); 47 }, 48 qr/Required plugin bundle Dist::Zilla::PluginBundle::DoesNotExist isn't installed\.\n\n/, 49 'missing plugin bundle is detected properly', 50); 51 52like( 53 exception { 54 Builder->from_config( 55 { dist_root => 't/does-not-exist' }, 56 { 57 add_files => { 58 'source/dist.ini' => simple_ini( 59 '@Bunk', 60 ), 61 }, 62 }, 63 ); 64 }, 65 # with Config::MVP 2.200009, we get: 66 # 'Can't locate object method "section_name" via package "Moose::Meta::Class::__ANON__::SERIAL::17" at lib/Dist/Zilla/Dist/Builder.pm line 269. 67 qr/Required plugin Dist::Zilla::Plugin::DoesNotExist isn't installed\.\n\n/, 68 'missing plugin within a bundle is detected properly', 69); 70 71done_testing; 72