X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F300_random_eval_bug.t;h=1bf1ccafbbd1d528fb24dec85c41e01eaf478a3e;hb=0cf811c0867feb0e846eb3bc1f34aee4a1f169f1;hp=112ae87bcc6b68c0ce8992cfd7ba4c65fc40c7eb;hpb=643f2f94ab780ca0c247cd36a88b13cc51d5c0fc;p=gitmo%2FClass-MOP.git diff --git a/t/300_random_eval_bug.t b/t/300_random_eval_bug.t index 112ae87..1bf1cca 100644 --- a/t/300_random_eval_bug.t +++ b/t/300_random_eval_bug.t @@ -1,7 +1,7 @@ use strict; use warnings; -use Test::More tests => 1; +use Test::More; use Class::MOP; @@ -22,26 +22,29 @@ Moral of the story: use strict; use warnings; use metaclass; - + sub new { my ($class) = @_; return bless {} => $class; - } - + } + sub employees { die "This didnt work"; } - + sub DESTROY { - my $self = shift; - foreach my $method ($self->meta->find_all_methods_by_name('DEMOLISH')) { - $method->{code}->($self); - } + my $self = shift; + foreach + my $method ( $self->meta->find_all_methods_by_name('DEMOLISH') ) { + $method->{code}->($self); + } } } -eval { - my $c = Company->new(); +eval { + my $c = Company->new(); $c->employees(); -}; -ok($@, '... we die correctly with bad args'); +}; +ok( $@, '... we die correctly with bad args' ); + +done_testing;