AGGREGATE_TESTS environment variable is set and a recent
Test::Aggregate is available. (rafl)
- POD formatting fix for Catalyst::Test (Dan Dascalescu)
+ - Bump to MooseX::MethodAttributes 0.08, to gain the
+ get_nearest_methods_with_attributes method allowing methods without
+ attributes in a subclass to override those with attributes in a superclass.
+ This fixes CatalystX::CRUD's method of overriding/disabling functionality
+ base controllers (t0m).
5.80002 2009-04-22 01:28:36
- Fix CATALYST_DEBUG and MYAPP_DEBUG environment variables
requires 'Scope::Upper' => '0.06';
requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00801';
requires 'Moose' => '0.73';
-requires 'MooseX::MethodAttributes::Inheritable' => '0.06';
+requires 'MooseX::MethodAttributes::Inheritable' => '0.08';
requires 'Carp';
requires 'Class::C3::Adopt::NEXT' => '0.07';
requires 'Class::MOP' => '0.79';
BEGIN { extends qw/Catalyst::Component MooseX::MethodAttributes::Inheritable/; }
+use MooseX::MethodAttributes;
use Catalyst::Exception;
use Catalyst::Utils;
my $meta = find_meta($self);
confess("Metaclass for " . ref($meta) ." for " . $meta->name
. " cannot support register_actions.")
- unless $meta->can('get_all_methods_with_attributes');
- my @methods = $meta->get_all_methods_with_attributes;
+ unless $meta->can('get_nearest_methods_with_attributes');
+ my @methods = $meta->get_nearest_methods_with_attributes;
return @methods;
}
use FindBin;
use lib "$FindBin::Bin/../lib";
-use Test::More tests => 5;
+use Test::More tests => 7;
use Catalyst::Test 'TestApp';
{
my $response = request('http://localhost/moose/get_attribute');
ok($response->is_success);
is($response->content, '42', 'attribute default values get set correctly');
+ is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected');
}
{
- my $response = request('http://localhost/moose/methodmodifiers/get_attribute');
- ok($response->is_success);
- is($response->content, '42', 'parent controller method called');
TODO: {
local $TODO = 'Wrapping methods in a subclass, when the subclass contains no other methods with attributes is broken';
+ my $response = request('http://localhost/moose/methodmodifiers/get_attribute');
+ ok($response->is_success);
+ is($response->content, '42', 'parent controller method called');
+ is($response->header('X-Catalyst-Test-Before'), 'before called', 'before works as expected');
is($response->header('X-Catalyst-Test-After'), 'after called', 'after works as expected');
}
}
use namespace::clean -except => 'meta';
BEGIN { extends qw/Catalyst::Controller/; }
+use MooseX::MethodAttributes; # FIXME - You need to say this if you have
+ # modifiers so that you get the correct
+ # method metaclass, why does the modifier
+ # on MODIFY_CODE_ATTRIBUTES not work.
has attribute => (
is => 'ro',
$c->response->body($self->attribute);
}
+before get_attribute => sub {
+ my ($self, $c) = @_;
+ $c->response->header( 'X-Catalyst-Test-Before' => 'before called' );
+};
+
1;