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=9d2b19a1509a720ef77d6c77641bbc56b40a2409;hpb=efd3d14c1cf03120dfd1ed7787f8050e55bb8319;p=gitmo%2FClass-MOP.git diff --git a/t/300_random_eval_bug.t b/t/300_random_eval_bug.t index 9d2b19a..1bf1cca 100644 --- a/t/300_random_eval_bug.t +++ b/t/300_random_eval_bug.t @@ -1,9 +1,7 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 1; +use Test::More; use Class::MOP; @@ -24,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'); \ No newline at end of file +}; +ok( $@, '... we die correctly with bad args' ); + +done_testing;