Regenerate test files
[gitmo/Mouse.git] / t / 030_roles / 014_more_alias_and_exclude.t
CommitLineData
67199842 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!!!
4use t::lib::MooseCompat;
67199842 5
6use strict;
7use warnings;
8
6475f69d 9use Test::More;
67199842 10use Test::Exception;
11
12
67199842 13{
14 package Foo;
15 use Mouse::Role;
6cfa1e5e 16
67199842 17 sub foo { 'Foo::foo' }
18 sub bar { 'Foo::bar' }
19 sub baz { 'Foo::baz' }
6cfa1e5e 20 sub gorch { 'Foo::gorch' }
21
67199842 22 package Bar;
23 use Mouse::Role;
24
25 sub foo { 'Bar::foo' }
26 sub bar { 'Bar::bar' }
27 sub baz { 'Bar::baz' }
6cfa1e5e 28 sub gorch { 'Bar::gorch' }
67199842 29
30 package Baz;
31 use Mouse::Role;
6cfa1e5e 32
67199842 33 sub foo { 'Baz::foo' }
34 sub bar { 'Baz::bar' }
35 sub baz { 'Baz::baz' }
6cfa1e5e 36 sub gorch { 'Baz::gorch' }
37
67199842 38 package Gorch;
39 use Mouse::Role;
6cfa1e5e 40
67199842 41 sub foo { 'Gorch::foo' }
42 sub bar { 'Gorch::bar' }
43 sub baz { 'Gorch::baz' }
6cfa1e5e 44 sub gorch { 'Gorch::gorch' }
67199842 45}
46
47{
48 package My::Class;
49 use Mouse;
6cfa1e5e 50
67199842 51 ::lives_ok {
6cfa1e5e 52 with 'Foo' => { -excludes => [qw/bar baz gorch/], -alias => { gorch => 'foo_gorch' } },
53 'Bar' => { -excludes => [qw/foo baz gorch/] },
54 'Baz' => { -excludes => [qw/foo bar gorch/], -alias => { foo => 'baz_foo', bar => 'baz_bar' } },
55 'Gorch' => { -excludes => [qw/foo bar baz/] };
67199842 56 } '... everything works out all right';
57}
58
59my $c = My::Class->new;
60isa_ok($c, 'My::Class');
61
62is($c->foo, 'Foo::foo', '... got the right method');
63is($c->bar, 'Bar::bar', '... got the right method');
64is($c->baz, 'Baz::baz', '... got the right method');
65is($c->gorch, 'Gorch::gorch', '... got the right method');
66
67is($c->foo_gorch, 'Foo::gorch', '... got the right method');
68is($c->baz_foo, 'Baz::foo', '... got the right method');
69is($c->baz_bar, 'Baz::bar', '... got the right method');
70
6475f69d 71done_testing;