Skip to content

Commit

Permalink
CX::Declare yet again goes deeper then expected
Browse files Browse the repository at this point in the history
  • Loading branch information
ruoso committed Jun 7, 2010
1 parent 26dd46f commit bdf94cc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/MooseX/Method/Signatures/Meta/Method.pm
Expand Up @@ -174,6 +174,16 @@ around wrap => sub {
return $self;
};

sub reify {
my $self = shift;

my %other_args = %{$self};
delete $other_args{body};
delete $other_args{actual_body};

return $self->meta->name->wrap($self->body, %other_args, @_);
}

sub _build_parsed_signature {
my ($self) = @_;
return Parse::Method::Signatures->signature(
Expand Down
9 changes: 8 additions & 1 deletion t/meta.t
@@ -1,6 +1,6 @@
use strict;
use warnings;
use Test::More tests => 7;
use Test::More tests => 8;
use Test::Exception;

use MooseX::Method::Signatures::Meta::Method;
Expand Down Expand Up @@ -71,4 +71,11 @@ lives_and(sub {
name => 'bar',
);
::isa_ok($method, 'Moose::Meta::Method');

# CatalystX::Declare uses reify directly. too bad.
my $other = $method->reify
( actual_body => sub { },
);
::isa_ok($method, 'Moose::Meta::Method');

});

0 comments on commit bdf94cc

Please sign in to comment.