Add a test for attribute conflict when composing one role into another
[gitmo/Moose.git] / t / 100_bugs / 013_lazybuild_required_undef.t
index 6a6d4fc..6afd8a9 100644 (file)
@@ -11,13 +11,13 @@ use Moose;
 #### or, make required accept undef and use a predicate test
 
 
-has 'foo' => ( isa => 'Int | Undef', is => 'rw', coerce => 1, lazy_build => 1 );
-has 'bar' => ( isa => 'Int | Undef', is => 'rw', coerce => 1 );
+has 'foo' => ( isa => 'Int | Undef', is => 'rw', lazy_build => 1 );
+has 'bar' => ( isa => 'Int | Undef', is => 'rw' );
 
 sub _build_foo { undef }
 
 package main;
-use Test::More tests => 4;
+use Test::More;
 
 ok ( !defined(Foo->new->bar), 'NonLazyBuild: Undef default' );
 ok ( !defined(Foo->new->bar(undef)), 'NonLazyBuild: Undef explicit' );
@@ -27,5 +27,4 @@ ok ( !defined(Foo->new->foo), 'LazyBuild: Undef default/lazy_build' );
 ## This test fails at the time of creation.
 ok ( !defined(Foo->new->foo(undef)), 'LazyBuild: Undef explicit' );
 
-
-1;
+done_testing;