X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F025_type_coersion_on_lazy_attributes.t;h=9400f1a31de220c5afb9ce1355d3867e5a4573be;hb=9864f0e4ba233c5f30ad6dc7c484ced43d883d27;hp=23b00261c51f5ae0afc3dfabd551fd454b05a440;hpb=8845df4dd6432e3164d078ade741409061adae9f;p=gitmo%2FMouse.git diff --git a/t/040_type_constraints/025_type_coersion_on_lazy_attributes.t b/t/040_type_constraints/025_type_coersion_on_lazy_attributes.t index 23b0026..9400f1a 100644 --- a/t/040_type_constraints/025_type_coersion_on_lazy_attributes.t +++ b/t/040_type_constraints/025_type_coersion_on_lazy_attributes.t @@ -1,12 +1,9 @@ #!/usr/bin/perl -# This is automatically generated by author/import-moose-test.pl. -# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! -use t::lib::MooseCompat; use strict; use warnings; -use Test::More; +use Test::More tests => 1; { package SomeClass; @@ -17,6 +14,7 @@ use Test::More; => where { /^6$/ }; subtype 'TextSix' => as 'Str' => where { /Six/i }; + coerce 'TextSix' => from 'DigitSix' => via { confess("Cannot live without 6 ($_)") unless /^6$/; 'Six' }; @@ -30,8 +28,6 @@ use Test::More; ); } -my $attr = SomeClass->meta->get_attribute('foo'); -is($attr->get_value(SomeClass->new()), 'Six'); is(SomeClass->new()->foo, 'Six'); -done_testing; +