summaryrefslogtreecommitdiffstats
path: root/t/35-no-service.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-06-14 16:04:36 -0500
committerJesse Luehrs <doy@tozt.net>2011-06-14 16:04:36 -0500
commit36ea288cc78dedaadd1d3b38331489646be26626 (patch)
tree4e2c123e9a1b0d8fe50036b03ab17af7850988ba /t/35-no-service.t
parent65028d365fcfa1f28b0f0e85e8443b3b1c9dad34 (diff)
downloadbread-board-declare-36ea288cc78dedaadd1d3b38331489646be26626.tar.gz
bread-board-declare-36ea288cc78dedaadd1d3b38331489646be26626.zip
remove test numbers
Diffstat (limited to 't/35-no-service.t')
-rw-r--r--t/35-no-service.t75
1 files changed, 0 insertions, 75 deletions
diff --git a/t/35-no-service.t b/t/35-no-service.t
deleted file mode 100644
index aeb4c48..0000000
--- a/t/35-no-service.t
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-use Test::More;
-use Test::Fatal;
-use Test::Moose;
-
-{
- package Bar;
- use Moose;
-}
-
-{
- package Foo;
- use Moose;
- use Bread::Board::Declare;
-
- has foo => (
- is => 'ro',
- isa => 'Str',
- );
-
- has bar => (
- is => 'ro',
- isa => 'Bar',
- service => 0,
- );
-
- has baz => (
- is => 'ro',
- isa => 'Str',
- block => sub { shift->param('foo') },
- dependencies => ['foo'],
- );
-
- has quux => (
- is => 'ro',
- isa => 'Bar',
- block => sub { shift->param('bar') },
- dependencies => ['bar'],
- );
-}
-
-with_immutable {
-{
- my $foo = Foo->new;
- ok($foo->has_service($_), "has service $_") for qw(foo baz);
- ok(!$foo->has_service($_), "doesn't have service $_") for qw(bar);
-}
-
-{
- my $foo = Foo->new;
- like(
- exception { $foo->baz },
- qr/^Attribute foo did not specify a service\. It must be given a value through the constructor or writer method before it can be resolved\./,
- "got the right error when foo isn't set"
- );
-}
-
-{
- my $foo = Foo->new(foo => 'bar');
- is($foo->baz, 'bar', "didn't get an error when foo is set");
-}
-
-{
- my $foo = Foo->new;
- like(
- exception { $foo->quux },
- qr/^Could not find container or service for bar in Foo/,
- "can't depend on attrs with no service"
- );
-}
-} 'Foo';
-
-done_testing;