6 use Test::More tests => 8;
9 # Some packages out in the wild cooperate with Moose by using goto
10 # &Moose::import. we want to make sure it still works.
25 goto &Moose::unimport;
32 MooseAlike1->import();
34 ::lives_ok( sub { has( 'size' ) },
35 'has was exported via MooseAlike1' );
37 MooseAlike1->unimport();
40 ok( ! Foo->can('has'),
41 'No has sub in Foo after MooseAlike1 is unimported' );
43 'Foo has a meta method' );
44 isa_ok( Foo->meta(), 'Moose::Meta::Class' );
55 my $import = \&Moose::import;
60 my $unimport = \&Moose::unimport;
69 MooseAlike2->import();
71 ::lives_ok( sub { has( 'size' ) },
72 'has was exported via MooseAlike2' );
74 MooseAlike2->unimport();
78 ok( ! Bar->can('has'),
79 'No has sub in Bar after MooseAlike2 is unimported' );
81 'Bar has a meta method' );
82 isa_ok( Bar->meta(), 'Moose::Meta::Class' );