From d1bab5d4a5ea4100803c871461c62744767c514b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 19 Jul 2010 19:21:54 -0500 Subject: a few more tests --- t/lib/Command.pm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 t/lib/Command.pm (limited to 't/lib/Command.pm') diff --git a/t/lib/Command.pm b/t/lib/Command.pm new file mode 100644 index 0000000..b39b8b5 --- /dev/null +++ b/t/lib/Command.pm @@ -0,0 +1,31 @@ +package Command; +use MooseX::Exporter::Easy; + +class_metaroles { + class => ['Command::Role::Class'], +}; + +sub _command_method_meta { + my ($meta) = @_; + Moose::Meta::Class->create_anon_class( + superclasses => [$meta->method_metaclass], + roles => ['Command::Role::Method'], + cache => 1, + )->name; +} + +with_meta command => sub { + my ($meta, $name, $code) = @_; + $meta->add_method( + $name => _command_method_meta($meta)->wrap( + $code, + name => $name, + package_name => $meta->name, + associated_metaclass => $meta + ), + ); +}; + +export; + +1; -- cgit v1.2.3-54-g00ecf