summaryrefslogtreecommitdiffstats
path: root/t/004_block_injection_w_out_class.t
diff options
context:
space:
mode:
Diffstat (limited to 't/004_block_injection_w_out_class.t')
-rw-r--r--t/004_block_injection_w_out_class.t25
1 files changed, 25 insertions, 0 deletions
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;