Created
March 7, 2010 05:50
-
-
Save clkao/324177 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use Test::More; | |
use AnyMQ; | |
our ($built, $demolished) = @_; | |
{ | |
package AnyMQ::Trait::Test; | |
use Moose::Role; | |
use Test::More; | |
sub BUILD {}; after 'BUILD' => sub { | |
$main::built++; | |
}; | |
sub DEMOLISH {}; after 'DEMOLISH' => sub { | |
$main::demolished++; | |
}; | |
} | |
my $bus = AnyMQ->new_with_traits( traits => ['Test']); | |
ok($bus->DOES('AnyMQ::Trait::Test')); | |
ok($built); | |
ok($demolished); | |
done_testing; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment