Changelogging
[gitmo/Mouse.git] / t / 001_mouse / 301-bugs-non-mouse.t
CommitLineData
9b2c1c4e 1#!/usr/bin/perl
9b2c1c4e 2use strict;
3use warnings;
4
8d85517c 5use Test::More;
eab81545 6use Test::Exception;
8d85517c 7my $warn = '';
8BEGIN { $SIG{__WARN__} = sub { $warn .= "@_" } }
9b2c1c4e 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" );
8d85517c 32 is( $g->oink, "oink", "inherited method from a non-Mouse class");
9b2c1c4e 33}
34
8d85517c 35is $warn, '', 'produces no warnings';
36done_testing;
9b2c1c4e 37