import some (modified) MXMS tests
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / no_signature.t
diff --git a/t/foreign/MooseX-Method-Signatures/no_signature.t b/t/foreign/MooseX-Method-Signatures/no_signature.t
new file mode 100644 (file)
index 0000000..8a447ba
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl
+use strict;
+use warnings FATAL => 'all';
+use Test::More;
+use Test::Fatal;
+
+{
+    package Foo;
+    use Function::Parameters qw(:strict);
+    method new($class:) { bless {}, $class }
+    method bar { 42 }
+}
+
+my $foo = Foo->new;
+
+is(exception {
+    $foo->bar
+}, undef, 'method without signature succeeds when called without args');
+
+is(exception {
+    $foo->bar(42)
+}, undef, 'method without signature succeeds when called with args');
+
+done_testing;