blob: 8ac4d65415530f9072cf5594a001ce2e61692d6a (
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
28
29
30
|
use v6;
use Test;
use Bread::Board;
# PERL6: doing anything at all with the type object for a role with required
# methods is broken
#sub does_ok(Mu $var, Mu $type, $msg = ("The object does '" ~ $type.perl ~ "'")) {
sub does_ok(Mu $var, Mu $type, $msg = ("The object does [some role]")) {
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
|