Commit | Line | Data |
6cfa1e5e |
1 | #!/usr/bin/env perl |
c47cf415 |
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; |
6cfa1e5e |
5 | use strict; |
6 | use warnings; |
c47cf415 |
7 | use Test::More; |
8 | $TODO = q{Mouse is not yet completed}; |
6cfa1e5e |
9 | |
10 | my $OPTS; |
11 | do { |
12 | package My::Singleton::Role; |
13 | use Mouse::Role; |
14 | |
15 | sub foo { 'My::Singleton::Role' } |
16 | |
17 | package My::Role::Metaclass; |
18 | use Mouse; |
19 | BEGIN { extends 'Mouse::Meta::Role' }; |
20 | |
21 | sub _role_for_combination { |
22 | my ($self, $opts) = @_; |
23 | $OPTS = $opts; |
24 | return My::Singleton::Role->meta; |
25 | } |
26 | |
27 | package My::Special::Role; |
28 | use Mouse::Role -metaclass => 'My::Role::Metaclass'; |
29 | |
30 | sub foo { 'My::Special::Role' } |
31 | |
32 | package My::Usual::Role; |
33 | use Mouse::Role; |
34 | |
35 | sub bar { 'My::Usual::Role' } |
36 | |
37 | package My::Class; |
38 | use Mouse; |
39 | |
40 | with ( |
41 | 'My::Special::Role' => { number => 1 }, |
42 | 'My::Usual::Role' => { number => 2 }, |
43 | ); |
44 | }; |
45 | |
46 | is(My::Class->foo, 'My::Singleton::Role', 'role_for_combination applied'); |
47 | is(My::Class->bar, 'My::Usual::Role', 'collateral role'); |
48 | is_deeply($OPTS, { number => 1 }); |
49 | |
c47cf415 |
50 | done_testing; |