r36580 - in /branches/upstream/libmoosex-traits-perl/current: Changes MANIFEST META.yml lib/MooseX/Traits.pm t/subclass.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu May 28 16:22:42 UTC 2009


Author: jawnsy-guest
Date: Thu May 28 16:22:38 2009
New Revision: 36580

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=36580
Log:
[svn-upgrade] Integrating new upstream version, libmoosex-traits-perl (0.05)

Added:
    branches/upstream/libmoosex-traits-perl/current/t/subclass.t
Modified:
    branches/upstream/libmoosex-traits-perl/current/Changes
    branches/upstream/libmoosex-traits-perl/current/MANIFEST
    branches/upstream/libmoosex-traits-perl/current/META.yml
    branches/upstream/libmoosex-traits-perl/current/lib/MooseX/Traits.pm

Modified: branches/upstream/libmoosex-traits-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-traits-perl/current/Changes?rev=36580&op=diff
==============================================================================
--- branches/upstream/libmoosex-traits-perl/current/Changes (original)
+++ branches/upstream/libmoosex-traits-perl/current/Changes Thu May 28 16:22:38 2009
@@ -1,3 +1,6 @@
+0.05    Thu May 28 08:37:21 MST 2009
+        - support subclasses of classes that use MX::Traits
+
 0.04    Tue May 26 23:00:29 MST 2009
         - add apply_traits method
         - use meta->constructor_name instead of 'new'

Modified: branches/upstream/libmoosex-traits-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-traits-perl/current/MANIFEST?rev=36580&op=diff
==============================================================================
--- branches/upstream/libmoosex-traits-perl/current/MANIFEST (original)
+++ branches/upstream/libmoosex-traits-perl/current/MANIFEST Thu May 28 16:22:38 2009
@@ -18,3 +18,4 @@
 t/author/pod-coverage.t
 t/author/pod.t
 t/basic.t
+t/subclass.t

Modified: branches/upstream/libmoosex-traits-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-traits-perl/current/META.yml?rev=36580&op=diff
==============================================================================
--- branches/upstream/libmoosex-traits-perl/current/META.yml (original)
+++ branches/upstream/libmoosex-traits-perl/current/META.yml Thu May 28 16:22:38 2009
@@ -22,4 +22,4 @@
   Moose::Role: 0
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.04
+version: 0.05

Modified: branches/upstream/libmoosex-traits-perl/current/lib/MooseX/Traits.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-traits-perl/current/lib/MooseX/Traits.pm?rev=36580&op=diff
==============================================================================
--- branches/upstream/libmoosex-traits-perl/current/lib/MooseX/Traits.pm (original)
+++ branches/upstream/libmoosex-traits-perl/current/lib/MooseX/Traits.pm Thu May 28 16:22:38 2009
@@ -1,7 +1,7 @@
 package MooseX::Traits;
 use Moose::Role;
 
-our $VERSION   = '0.04';
+our $VERSION   = '0.05';
 our $AUTHORITY = 'id:JROCKWAY';
 
 has '_trait_namespace' => (
@@ -15,7 +15,7 @@
 
 my $transform_trait = sub {
     my ($class, $name) = @_;
-    my $namespace = $class->meta->get_attribute('_trait_namespace');
+    my $namespace = $class->meta->find_attribute_by_name('_trait_namespace');
     my $base;
     if($namespace->has_default){
         $base = $namespace->default;

Added: branches/upstream/libmoosex-traits-perl/current/t/subclass.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libmoosex-traits-perl/current/t/subclass.t?rev=36580&op=file
==============================================================================
--- branches/upstream/libmoosex-traits-perl/current/t/subclass.t (added)
+++ branches/upstream/libmoosex-traits-perl/current/t/subclass.t Thu May 28 16:22:38 2009
@@ -1,0 +1,26 @@
+use strict;
+use warnings;
+use Test::More tests => 3;
+use Test::Exception;
+
+{ package Foo;
+  use Moose;
+  with 'MooseX::Traits';
+
+  package Bar;
+  use Moose;
+  extends 'Foo';
+
+  package Trait;
+  use Moose::Role;
+
+  sub foo { return 42 };
+}
+
+my $instance;
+lives_ok {
+    $instance = Bar->new_with_traits( traits => ['Trait'] );
+} 'creating instance works ok';
+
+ok $instance->does('Trait'), 'instance does trait';
+is $instance->foo, 42, 'trait works';




More information about the Pkg-perl-cvs-commits mailing list