From b808141b894ad538db75a7067e0199cbfe6337a9 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Sun, 24 Aug 2014 16:36:19 +0000 Subject: Module-Implementation-0.09 --- t/both-fail.t | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 t/both-fail.t (limited to 't/both-fail.t') diff --git a/t/both-fail.t b/t/both-fail.t new file mode 100644 index 0000000..e21cb78 --- /dev/null +++ b/t/both-fail.t @@ -0,0 +1,28 @@ +use strict; +use warnings; + +use Test::More 0.88; +use Test::Fatal 0.006; + +{ + package T; + + use strict; + use warnings; + + use lib 't/lib'; + + use Module::Implementation; + my $loader = Module::Implementation::build_loader_sub( + implementations => [ 'ImplFails1', 'ImplFails2' ], + symbols => [qw( return_42 )], + ); + + ::like( + ::exception{ $loader->() }, + qr/Could not find a suitable T implementation/, + 'Got an exception when all implementations fail to load' + ); +} + +done_testing(); -- cgit v1.2.1