More tests
[gitmo/Perl-Critic-Dynamic-Moose.git] / t / DynamicMoose / ProhibitPublicBuilders.run
index ceff4ed..dc83fe4 100644 (file)
@@ -9,3 +9,60 @@ has attr => (
     is => 'rw',
 );
 
+#-----------------------------------------------------------------------------
+
+## name Private builder method
+## failures 0
+## cut
+
+package Class;
+use Moose;
+
+has attr => (
+    is => 'rw',
+    builder => '_build_attr',
+);
+
+#-----------------------------------------------------------------------------
+
+## name Public builder method
+## failures 1
+## cut
+
+package Class;
+use Moose;
+
+has attr => (
+    is => 'rw',
+    builder => 'build_attr',
+);
+
+#-----------------------------------------------------------------------------
+
+## name Public builder method, declared dynamically
+## failures 1
+## cut
+
+package Class;
+use Moose;
+
+__PACKAGE__->meta->add_attribute(attr => (
+    is => 'rw',
+    builder => 'build_attr',
+));
+
+#-----------------------------------------------------------------------------
+
+## name Public builder method, named dynamically
+## failures 1
+## cut
+
+package Class;
+use Moose;
+
+my $builder = 'build_' . rand;
+__PACKAGE__->meta->add_attribute(attr => (
+    is => 'rw',
+    builder => $builder,
+));
+