bfa53a4fc3a1195ae80ba1656ecb87bad46ba160
[gitmo/Mouse.git] / t / 301-bugs-non-mouse.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More 'no_plan';
7 use Test::Exception;
8
9 {
10     package Foo;
11     use Mouse;
12
13     has foo => ( is => "rw" );
14
15     package Bar;
16     sub oink { "oink" }
17
18     package Gorch;
19     use Mouse;
20
21     extends qw(Bar Foo);
22
23     ::lives_ok{
24         has '+foo' => ( default => "the default" );
25     } 'inherit attr when @ISA contains a non Mouse class before a Mouse class with the base attr';
26 }
27
28 {
29     my $g = Gorch->new;
30
31     is( $g->foo, "the default", "inherited attribute" );
32 }
33
34