summaryrefslogtreecommitdiffstats
path: root/t/031_custom_lifecycles.t
diff options
context:
space:
mode:
Diffstat (limited to 't/031_custom_lifecycles.t')
-rw-r--r--t/031_custom_lifecycles.t27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/031_custom_lifecycles.t b/t/031_custom_lifecycles.t
new file mode 100644
index 0000000..549c316
--- /dev/null
+++ b/t/031_custom_lifecycles.t
@@ -0,0 +1,27 @@
+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);
+}
+
+role MyLifeCycle does Singleton { }
+
+class MyClass { }
+
+my $s = Bread::Board::ConstructorInjection.new(
+ lifecycle => MyLifeCycle,
+ name => 'foo',
+ class => MyClass,
+);
+
+does_ok($s, MyLifeCycle);
+
+done;
+
+# vim:ft=perl6:foldmethod=manual