summaryrefslogtreecommitdiffstats
path: root/t/004_block_injection_w_out_class.t
blob: 622335daeb51e7ce7eb2af7cf4c8c04196d21c90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use v6;
use Test;

use Bread::Board;

sub does_ok(Mu $var, Mu $type, $msg = ("The object does '" ~ $type.perl ~ "'")) {
    ok($var.does($type), $msg);
}

my $s = Bread::Board::BlockInjection.new(
    name         => 'NoClass',
    block        => -> $s { return { foo => $s.param('foo') } },
    dependencies => {
        foo => Bread::Board::Literal.new(name => 'foo', value => 'FOO');
    },
);

isa_ok($s, Bread::Board::BlockInjection);
does_ok($s, Bread::Board::Service);

my $x = $s.get;
isa_ok($x, Hash);
is_deeply($x, { foo => 'FOO' });

done;

# vim:ft=perl6:foldmethod=manual