also allow suppressing the meta method during CMOP::Class->create
[gitmo/Class-MOP.git] / t / 048_anon_class_create_init.t
CommitLineData
34d04967 1use strict;
2use warnings;
3
86a4d873 4use Test::More;
34d04967 5
6use Class::MOP;
7
8{
9 package MyMeta;
10 use base 'Class::MOP::Class';
11 sub initialize {
12 my $class = shift;
13 my ( $package, %options ) = @_;
14 ::cmp_ok( $options{foo}, 'eq', 'this',
15 'option passed to initialize() on create_anon_class()' );
16 return $class->SUPER::initialize( @_ );
17 }
18
19}
20
21my $anon = MyMeta->create_anon_class( foo => 'this' );
22isa_ok( $anon, 'MyMeta' );
23
86a4d873 24done_testing;