Require Dist::Zilla 4.200016+
[gitmo/Moose.git] / t / roles / conflict_many_methods.t
CommitLineData
e893345e 1#!/usr/bin/perl
2use strict;
3use warnings;
4
a28e50e4 5use Test::More;
b10dde3a 6use Test::Fatal;
e893345e 7
8{
9 package Bomb;
10 use Moose::Role;
11
12 sub fuse { }
13 sub explode { }
14
15 package Spouse;
16 use Moose::Role;
17
18 sub fuse { }
19 sub explode { }
20
21 package Caninish;
22 use Moose::Role;
23
24 sub bark { }
25
26 package Treeve;
27 use Moose::Role;
28
29 sub bark { }
30}
31
a28e50e4 32{
33 package PracticalJoke;
34 use Moose;
35
b10dde3a 36 ::like( ::exception {
a28e50e4 37 with 'Bomb', 'Spouse';
b10dde3a 38 }, qr/Due to method name conflicts in roles 'Bomb' and 'Spouse', the methods 'explode' and 'fuse' must be implemented or excluded by 'PracticalJoke'/ );
a28e50e4 39
b10dde3a 40 ::like( ::exception {
a28e50e4 41 with (
42 'Bomb', 'Spouse',
43 'Caninish', 'Treeve',
44 );
b10dde3a 45 }, qr/Due to a method name conflict in roles 'Caninish' and 'Treeve', the method 'bark' must be implemented or excluded by 'PracticalJoke'/ );
a28e50e4 46}
e893345e 47
a28e50e4 48done_testing;