Getopt shouldn't require ConfigFromFile role applied at same level
[gitmo/MooseX-Getopt.git] / t / 008_configfromfile.t
index affcd7e..93700b9 100644 (file)
@@ -12,7 +12,7 @@ if ( !eval { require MooseX::ConfigFromFile } )
 }
 else
 {
-    plan tests => 24;
+    plan tests => 25;
 }
 
 {
@@ -150,6 +150,27 @@ else
         '... optional_from_config is undef as expected' );
 }
 
+{
+    package BaseApp::WithConfig;
+    use Moose;
+    with 'MooseX::ConfigFromFile';
+
+    sub get_config_from_file { return {}; }
+}
+
+{
+    package DerivedApp::Getopt;
+    use Moose;
+    extends 'BaseApp::WithConfig';
+    with 'MooseX::Getopt';
+}
+
+# With DerivedApp, the Getopt role was applied at a different level
+# than the ConfigFromFile role
+{
+    lives_ok { DerivedApp::Getopt->new_with_options } 'Can create DerivedApp';
+}
+
 sub app_ok {
     my $app = shift;