summaryrefslogtreecommitdiffstats
path: root/t/004_block_injection_w_out_class.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-12-27 05:28:07 -0600
committerJesse Luehrs <doy@tozt.net>2012-12-27 05:28:07 -0600
commit8e670dd6512860312aa9ee3dd59c71fba7f182a5 (patch)
treebaa20f7ab111ea9f1f32dbadab9eeead4b32f1c5 /t/004_block_injection_w_out_class.t
parent18e0c21c891deec7847d2cb43fc4e48d85baa219 (diff)
downloadp6-bread-board-8e670dd6512860312aa9ee3dd59c71fba7f182a5.tar.gz
p6-bread-board-8e670dd6512860312aa9ee3dd59c71fba7f182a5.zip
block services
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;