From 8e670dd6512860312aa9ee3dd59c71fba7f182a5 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 27 Dec 2012 05:28:07 -0600 Subject: block services --- t/004_block_injection_w_out_class.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t/004_block_injection_w_out_class.t (limited to 't/004_block_injection_w_out_class.t') diff --git a/t/004_block_injection_w_out_class.t b/t/004_block_injection_w_out_class.t new file mode 100644 index 0000000..3ff775e --- /dev/null +++ b/t/004_block_injection_w_out_class.t @@ -0,0 +1,25 @@ +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; -- cgit v1.2.3-54-g00ecf