Move t/*/t into t/001_mouse
[gitmo/Mouse.git] / t / 001_mouse / 038-main.t
diff --git a/t/001_mouse/038-main.t b/t/001_mouse/038-main.t
new file mode 100644 (file)
index 0000000..6f68a4f
--- /dev/null
@@ -0,0 +1,23 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+BEGIN {
+    eval "use Test::Output;";
+    plan skip_all => "Test::Output is required for this test" if $@;
+    plan tests => 2;
+}
+
+stderr_is(
+    sub { package main; eval 'use Mouse' },
+    "Mouse does not export its sugar to the 'main' package.\n",
+    'Mouse warns when loaded from the main package',
+);
+
+stderr_is(
+    sub { package main; eval 'use Mouse::Role' },
+    "Mouse::Role does not export its sugar to the 'main' package.\n",
+    'Mouse::Role warns when loaded from the main package',
+);
+