Commit | Line | Data |
---|---|---|
34d04967 | 1 | use strict; |
2 | use warnings; | |
3 | ||
4 | use Test::More tests => 2; | |
5 | ||
6 | use 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 | ||
21 | my $anon = MyMeta->create_anon_class( foo => 'this' ); | |
22 | isa_ok( $anon, 'MyMeta' ); | |
23 |