From eb3f39183f1e1039a4d9a73cb1c2b19ea514c436 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 21 Feb 2011 12:52:56 -0600 Subject: also disallow builder --- t/32-defaults.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 't') diff --git a/t/32-defaults.t b/t/32-defaults.t index d3f1485..a40a235 100644 --- a/t/32-defaults.t +++ b/t/32-defaults.t @@ -29,6 +29,16 @@ use Test::Fatal; }, qr/default is not valid when Bread::Board service options are set/, "can't set a default when creating a service"); + ::like(::exception { + has bar2 => ( + is => 'ro', + isa => 'Str', + builder => '_build_bar2', + value => 'FOO', + ); + }, qr/builder is not valid when Bread::Board service options are set/, + "can't set a builder when creating a service"); + ::like(::exception { has baz => ( is => 'ro', @@ -50,6 +60,27 @@ use Test::Fatal; ); }, qr/default is not valid when Bread::Board service options are set/, "can't set a default when creating a service"); + + ::like(::exception { + has quux2 => ( + is => 'ro', + isa => 'Str', + lazy => 1, + builder => '_build_quux2', + value => 'FOO', + ); + }, qr/builder is not valid when Bread::Board service options are set/, + "can't set a builder when creating a service"); + + ::like(::exception { + has quux3 => ( + is => 'ro', + isa => 'Str', + lazy_build => 1, + value => 'FOO', + ); + }, qr/builder is not valid when Bread::Board service options are set/, + "can't set lazy_build when creating a service"); } done_testing; -- cgit v1.2.3-54-g00ecf