Ignore __INSTANCE__ as constructor arg
[gitmo/MooseX-StrictConstructor.git] / t / instance.t
diff --git a/t/instance.t b/t/instance.t
new file mode 100644 (file)
index 0000000..687b470
--- /dev/null
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Moose qw( with_immutable );
+
+{
+    package Foo;
+    use Moose;
+    use MooseX::StrictConstructor;
+}
+
+with_immutable {
+    eval { Foo->new( __INSTANCE__ => Foo->new ); };
+    ok( !$@, '__INSTANCE__ is ignored when passed to ->new' );
+
+    eval { Foo->meta->new_object( __INSTANCE__ => Foo->new ); };
+    ok( !$@, '__INSTANCE__ is ignored when passed to ->new_object' );
+}
+'Foo';
+
+done_testing();