summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-12-29 14:55:52 -0600
committerJesse Luehrs <doy@tozt.net>2012-12-29 14:55:52 -0600
commit12f66a21e1b387d9674e60ad7e9ed02d85089162 (patch)
tree0d4e8874dd9ce0ac56480795458697b1f8373b62
parent3829bb039a3ee5640c0d3e0cc00039fda85ce54a (diff)
downloadp6-bread-board-12f66a21e1b387d9674e60ad7e9ed02d85089162.tar.gz
p6-bread-board-12f66a21e1b387d9674e60ad7e9ed02d85089162.zip
another test
-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