Browse files

bah, actually test for the right thing

  • Loading branch information...
1 parent 5342130 commit 63461d8c39ed972caf8c48fb4d7e66683e4fe97a @doy committed Jun 30, 2010
Showing with 37 additions and 1 deletion.
  1. +3 −0 Changes
  2. +1 −1 lib/MooseX/NonMoose/Meta/Role/Class.pm
  3. +33 −0 t/07-extends-moose-object.t
View
3 Changes
@@ -1,6 +1,9 @@
Revision history for MooseX-NonMoose
{{$NEXT}}
+ - Actually use the right test.
+
+0.10 2010-06-30
- Don't break if someone specifies a version to extends.
0.09 2010-06-15
View
2 lib/MooseX/NonMoose/Meta/Role/Class.pm
@@ -219,7 +219,7 @@ around superclasses => sub {
my @superclasses = @_;
push @superclasses, 'Moose::Object'
- unless grep { blessed($_) && $_->isa('Moose::Object') } @superclasses;
+ unless grep { !ref($_) && $_->isa('Moose::Object') } @superclasses;
my @ret = $self->$orig(@superclasses);
View
33 t/07-extends-moose-object.t
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package Foo;
+ sub new { bless {}, shift }
+}
+
+{
+ package Foo::Sub;
+ use Moose;
+ use MooseX::NonMoose;
+ extends 'Foo';
+}
+
+{
+ package Bar;
+ use Moose;
+}
+
+{
+ package Bar::Sub;
+ use Moose;
+ use MooseX::NonMoose;
+ extends 'Bar';
+}
+
+is_deeply(\@Foo::Sub::ISA, ['Foo', 'Moose::Object'], "Moose::Object was added");
+is_deeply(\@Bar::Sub::ISA, ['Bar'], "Moose::Object wasn't added");
+
+done_testing;

0 comments on commit 63461d8

Please sign in to comment.