Merge branch 'master' into topic/strict_export_list
[gitmo/Moose.git] / t / 050_metaclasses / 012_moose_exporter.t
index ef9db42..41cd0f6 100644 (file)
@@ -8,7 +8,7 @@ use Test::Exception;
 BEGIN {
     eval "use Test::Output;";
     plan skip_all => "Test::Output is required for this test" if $@;
-    plan tests => 63;
+    plan tests => 65;
 }
 
 
@@ -292,6 +292,27 @@ BEGIN {
 }
 
 {
+    package NonExistentExport;
+
+    use Moose ();
+
+    ::stderr_like {
+        Moose::Exporter->setup_import_methods(
+            also => ['Moose'],
+            with_caller => ['does_not_exist'],
+        );
+    } qr/^Trying to export undefined sub NonExistentExport::does_not_exist/,
+      "warns when a non-existent method is requested to be exported";
+}
+
+{
+    package WantsNonExistentExport;
+
+    NonExistentExport->import;
+
+    ::ok(!__PACKAGE__->can('does_not_exist'),
+         "undefined subs do not get exported");
+
     package AllOptions;
     use Moose ();
     use Moose::Exporter;