From 36ea288cc78dedaadd1d3b38331489646be26626 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 14 Jun 2011 16:04:36 -0500 Subject: remove test numbers --- t/defaults.t | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 t/defaults.t (limited to 't/defaults.t') diff --git a/t/defaults.t b/t/defaults.t new file mode 100644 index 0000000..7350d52 --- /dev/null +++ b/t/defaults.t @@ -0,0 +1,86 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; +use Test::Fatal; + +{ + package Foo; + use Moose; + use Bread::Board::Declare; + + ::like(::exception { + has foo => ( + is => 'ro', + isa => 'Str', + default => 'OOF', + value => 'FOO', + ); + }, qr/default is not valid when Bread::Board service options are set/, + "can't set a default when creating a service"); + + ::like(::exception { + has bar => ( + is => 'ro', + isa => 'Str', + default => sub { 'OOF' }, + value => 'FOO', + ); + }, 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', + isa => 'Str', + lazy => 1, + default => 'OOF', + value => 'FOO', + ); + }, qr/default is not valid when Bread::Board service options are set/, + "can't set a default when creating a service"); + + ::like(::exception { + has quux => ( + is => 'ro', + isa => 'Str', + lazy => 1, + default => sub { 'OOF' }, + value => 'FOO', + ); + }, 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