Commit | Line | Data |
41888e7d |
1 | #!/usr/bin/perl |
fde8e43f |
2 | # This is automatically generated by author/import-moose-test.pl. |
3 | # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! |
4 | use t::lib::MooseCompat; |
41888e7d |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
fde8e43f |
9 | use Test::More; |
10 | $TODO = q{Mouse is not yet completed}; |
41888e7d |
11 | use Test::Exception; |
12 | |
13 | |
41888e7d |
14 | BEGIN { |
15 | package MyFramework::Base; |
16 | use Mouse; |
17 | |
18 | package MyFramework::Meta::Base; |
19 | use Mouse; |
20 | |
21 | extends 'Mouse::Meta::Class'; |
22 | |
23 | package MyFramework; |
24 | use Mouse; |
fde8e43f |
25 | use Mouse::Deprecated -api_version => '0.55'; |
41888e7d |
26 | |
27 | sub import { |
28 | my $CALLER = caller(); |
29 | |
30 | strict->import; |
31 | warnings->import; |
32 | |
33 | return if $CALLER eq 'main'; |
34 | Mouse::init_meta( $CALLER, 'MyFramework::Base', 'MyFramework::Meta::Base' ); |
35 | Mouse->import({ into => $CALLER }); |
36 | |
37 | return 1; |
38 | } |
39 | } |
40 | |
41 | { |
42 | package MyClass; |
43 | BEGIN { MyFramework->import } |
44 | |
45 | has 'foo' => (is => 'rw'); |
46 | } |
47 | |
48 | can_ok( 'MyClass', 'meta' ); |
49 | |
50 | isa_ok(MyClass->meta, 'MyFramework::Meta::Base'); |
51 | isa_ok(MyClass->meta, 'Mouse::Meta::Class'); |
52 | |
53 | my $obj = MyClass->new(foo => 10); |
54 | isa_ok($obj, 'MyClass'); |
55 | isa_ok($obj, 'MyFramework::Base'); |
56 | isa_ok($obj, 'Mouse::Object'); |
57 | |
58 | is($obj->foo, 10, '... got the right value'); |
59 | |
fde8e43f |
60 | done_testing; |