10 unless ( eval 'use Test::Warn 0.10; 1' ) {
11 plan skip_all => 'These tests require Test::Warn 0.10+';
22 extends 'Moose::Object';
24 before 'new' => sub { warn "Making a new " . $_[0] };
30 package MyApp::UseMyBase;
34 Moose::Exporter->setup_import_methods( also => 'Moose' );
38 Moose->init_meta( @_, base_class => 'MyApp::Base' );
45 MyApp::UseMyBase->import;
47 has( 'size' => ( is => 'rw' ) );
50 ok( Foo->isa('MyApp::Base'),
51 'Foo isa MyApp::Base' );
54 'Foo has a size method' );
57 warning_is( sub { $foo = Foo->new( size => 2 ) },
59 'got expected warning when calling Foo->new' );
61 is( $foo->size(), 2, '$foo->size is 2' );