From cda7c4e67f52a39187e669978c2b7eddfca68811 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 10 Sep 2009 18:40:51 -0500 Subject: add a simple test --- t/001-basic.t | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 t/001-basic.t (limited to 't') 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'); -- cgit v1.2.3-54-g00ecf