From: Dave Rolsky Date: Fri, 20 Feb 2009 17:30:32 +0000 (+0000) Subject: Perltidy this test file X-Git-Tag: 0.71_01~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41fd598a19158f1ee95ce05740e9541e574383e0;p=gitmo%2FMoose.git Perltidy this test file --- diff --git a/t/020_attributes/020_trigger_and_coerce.t b/t/020_attributes/020_trigger_and_coerce.t index 208068e..182d03d 100644 --- a/t/020_attributes/020_trigger_and_coerce.t +++ b/t/020_attributes/020_trigger_and_coerce.t @@ -8,49 +8,49 @@ use Test::Exception; -{ +{ + package Fake::DateTime; use Moose; - - has 'string_repr' => (is => 'ro'); - + + has 'string_repr' => ( is => 'ro' ); + package Mortgage; use Moose; use Moose::Util::TypeConstraints; - coerce 'Fake::DateTime' - => from 'Str' - => via { Fake::DateTime->new(string_repr => $_) }; + coerce 'Fake::DateTime' => from 'Str' => + via { Fake::DateTime->new( string_repr => $_ ) }; has 'closing_date' => ( - is => 'rw', - isa => 'Fake::DateTime', - coerce => 1, - trigger => sub { - my ( $self, $val ) = @_; - ::pass('... trigger is being called'); - ::isa_ok($self->closing_date, 'Fake::DateTime'); - ::isa_ok($val, 'Fake::DateTime'); - } + is => 'rw', + isa => 'Fake::DateTime', + coerce => 1, + trigger => sub { + my ( $self, $val ) = @_; + ::pass('... trigger is being called'); + ::isa_ok( $self->closing_date, 'Fake::DateTime' ); + ::isa_ok( $val, 'Fake::DateTime' ); + } ); } { my $mtg = Mortgage->new( closing_date => 'yesterday' ); - isa_ok($mtg, 'Mortgage'); + isa_ok( $mtg, 'Mortgage' ); # check that coercion worked - isa_ok($mtg->closing_date, 'Fake::DateTime'); + isa_ok( $mtg->closing_date, 'Fake::DateTime' ); } Mortgage->meta->make_immutable; -ok(Mortgage->meta->is_immutable, '... Mortgage is now immutable'); +ok( Mortgage->meta->is_immutable, '... Mortgage is now immutable' ); { my $mtg = Mortgage->new( closing_date => 'yesterday' ); - isa_ok($mtg, 'Mortgage'); + isa_ok( $mtg, 'Mortgage' ); # check that coercion worked - isa_ok($mtg->closing_date, 'Fake::DateTime'); + isa_ok( $mtg->closing_date, 'Fake::DateTime' ); }