Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CX::Declare yet again goes deeper then expected

  • Loading branch information...
commit bdf94ccaffe53d6175d49572f95c5a8dce55b1d5 1 parent 26dd46f
@ruoso ruoso authored
Showing with 18 additions and 1 deletion.
  1. +10 −0 lib/MooseX/Method/Signatures/Meta/Method.pm
  2. +8 −1 t/meta.t
View
10 lib/MooseX/Method/Signatures/Meta/Method.pm
@@ -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(
View
9 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;
@@ -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');
+
});
Please sign in to comment.
Something went wrong with that request. Please try again.