Skip Menu |
 

This queue is for tickets about the MooseX-MethodAttributes CPAN distribution.

Report information
The Basics
Id: 58237
Status: open
Priority: 0/
Queue: MooseX-MethodAttributes

People
Owner: Nobody in particular
Requestors: DAVEWOOD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: attributes in role {}; get corrupted
Download (untitled) / with headers
text/plain 679b
If I use Controller actions inside Moose roles like t0m describes in his blog (http://bobtfish.livejournal.com/264317.html) but use + use MooseX::Role::Parameterized -traits => 'MooseX::MethodAttributes::Role::Meta::Role'; instead of - use Moose::Role -traits => 'MooseX::MethodAttributes::Role::Meta::Role'; I cannot attach to Chained subs anymore when the chain start sub is inside of the role{} block. the attached test should succeed but fails. apparently (but thats just newbie talk) he attributes in role{ method foo => sub :Chained { ... } }; are corrupted in 'some way' ps: my first bugreport here, pardon for anything I haven't done correctly. feedback welcome
Subject: param_role_with_chained.t
Heya, you didn't seem to attach the test case..
Download (untitled) / with headers
text/plain 147b
On Tue Jun 15 16:29:12 2010, BOBTFISH wrote: Show quoted text
> Heya, you didn't seem to attach the test case..
I did attach a file it just happened to be empty.
Subject: param_role_with_chained.t
use strict; use warnings; { package Catalyst::Controller; use Moose; use namespace::clean -except => 'meta'; use MooseX::MethodAttributes; BEGIN { extends 'MooseX::MethodAttributes::Inheritable'; } } { package ControllerRole; use MooseX::Role::Parameterized -traits => 'MooseX::MethodAttributes::Role::Meta::Role'; use namespace::clean -except => 'meta'; parameter foo => ( isa => "Str", ); role { my $p = shift; method base => sub : Chained('') PathPart('base') CaptureArgs(0) { }; }; sub index : Chained('base') PathPart('index') Args(0) { } } { package TestApp::Controller::Foo; use Moose; use namespace::clean -except => 'meta'; BEGIN { extends qw/Catalyst::Controller/; } with 'ControllerRole' => { foo => 23}; } use Test::More tests => 1; BEGIN { eval { require MooseX::Role::Parameterized } or plan skip_all => 'This test needs MooseX::Role::Parameterized' } is_deeply( TestApp::Controller::Foo->meta->get_method('base')->attributes, [q{Chained('')}, q{PathPart('base')}, q{CaptureArgs(0)}], ); done_testing;


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.