From: Toby Inkster Date: Fri, 19 Oct 2012 13:52:10 +0000 (+0100) Subject: tests for around does => sub {...} X-Git-Tag: v1.002000~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3b0234be8582485d7a92404904d5befb8cfb1bb3;p=gitmo%2FRole-Tiny.git tests for around does => sub {...} --- diff --git a/t/around-does.t b/t/around-does.t new file mode 100644 index 0000000..3b36d5d --- /dev/null +++ b/t/around-does.t @@ -0,0 +1,31 @@ +use Test::More; + +my $pass; +my $pass2; + +BEGIN { + package Local::Role; + use Role::Tiny; + around does => sub { + my ($orig, $self, @args) = @_; + $pass++; + return $self->$orig(@args); + }; + around DOES => sub { + my ($orig, $self, @args) = @_; + $pass2++; + return $self->$orig(@args); + }; +} + +BEGIN { + package Local::Class; + use Role::Tiny::With; + with 'Local::Role'; +} + +ok(Local::Class->does('Local::Role')); +ok($pass); +ok(Local::Class->DOES('Local::Role')); +ok($pass2); +done_testing(); \ No newline at end of file