summaryrefslogtreecommitdiffstats
path: root/t/inline-services.t
diff options
context:
space:
mode:
Diffstat (limited to 't/inline-services.t')
-rw-r--r--t/inline-services.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/t/inline-services.t b/t/inline-services.t
new file mode 100644
index 0000000..fc047c8
--- /dev/null
+++ b/t/inline-services.t
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package Foo;
+ use Moose;
+ use Bread::Board::Declare;
+
+ has foo => (
+ is => 'ro',
+ isa => 'Str',
+ block => sub {
+ my ($s) = @_;
+ return 'foo' . $s->param('bar') . $s->param('baz');
+ },
+ dependencies => {
+ bar => dep('bar'),
+ baz => dep(value => 'zab'),
+ },
+ );
+
+ has bar => (
+ is => 'ro',
+ isa => 'Str',
+ value => 'BAR',
+ );
+}
+
+is(Foo->new->foo, 'fooBARzab', "inline dependencies resolved properly");
+
+done_testing;