Skip to content

Commit

Permalink
test extending accessor generator with non-Moo parent
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Jul 24, 2015
1 parent cde3211 commit fca5c15
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions t/accessor-generator-extension.t
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,27 @@ $o = $c->new(one => 1, two => 2, three => 3, four => 4);

is_deeply([ @$o ], [ 1, 2, 3, 4 ], 'Generated subclass object w/role');

{
package ArrayNonMoo;
sub new { bless [], $_[0] }
}

{
package ArrayTest4;

use Moo;
use MooX::ArrayRef;

extends 'ArrayNonMoo';

has one => (is => 'ro');
has two => (is => 'ro');
has three => (is => 'ro');
has four => (is => 'ro');
}

$o = ArrayTest4->new(one => 1, two => 2, three => 3, four => 4);

is_deeply([ @$o ], [ 1, 2, 3, 4 ], 'Subclass of non-Moo object');

done_testing;

0 comments on commit fca5c15

Please sign in to comment.