summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/001-basic.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/001-basic.t b/t/001-basic.t
new file mode 100644
index 0000000..a3b51eb
--- /dev/null
+++ b/t/001-basic.t
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 3;
+use Test::Moose;
+
+BEGIN {
+ package Foo::Exporter;
+ use MooseX::MethodTraits;
+
+ MooseX::MethodTraits->setup_import_methods(
+ with_traits => {
+ command => {
+ traits => ['Foo::Command'],
+ }
+ }
+ );
+}
+
+{
+ package Foo::Command;
+ use Moose::Role;
+}
+
+{
+ package Foo;
+ use Moose;
+ BEGIN { Foo::Exporter->import }
+
+ command foo => sub { 'FOO' };
+}
+
+my $foo = Foo->new;
+can_ok($foo, 'foo');
+my $method = Foo->meta->get_method('foo');
+does_ok($method, 'Foo::Command');
+is($foo->foo, 'FOO', 'correct method is installed');