File Coverage

blib/lib/Moose/Exception/MetaclassIsAClassNotASubclassOfGivenMetaclass.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Moose::Exception::MetaclassIsAClassNotASubclassOfGivenMetaclass;
2             our $VERSION = '2.2206';
3              
4 1     1   588 use Moose;
  1         3  
  1         13  
5             extends 'Moose::Exception';
6             with 'Moose::Exception::Role::Class';
7              
8 1     1   9 use Moose::Util 'find_meta';
  1         3  
  1         10  
9              
10             has 'metaclass' => (
11             is => 'ro',
12             isa => 'Str',
13             required => 1
14             );
15              
16             sub _build_message {
17 1     1   3 my $self = shift;
18 1         35 my $class = find_meta( $self->class_name );
19 1         35 $self->class_name." already has a metaclass, but it does not inherit ".$self->metaclass.
20             " ($class). You cannot make the same thing a role and a class. Remove either Moose or Moose::Role.";
21             }
22              
23             __PACKAGE__->meta->make_immutable;
24             1;