Make MUTC load Moose before trying to use it to throw an error.
[gitmo/Moose.git] / t / 040_type_constraints / 032_throw_error.t
diff --git a/t/040_type_constraints/032_throw_error.t b/t/040_type_constraints/032_throw_error.t
new file mode 100644 (file)
index 0000000..2d15a06
--- /dev/null
@@ -0,0 +1,12 @@
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+use Moose::Util::TypeConstraints;
+
+
+eval { Moose::Util::TypeConstraints::create_type_constraint_union() };
+
+like( $@, qr/\QYou must pass in at least 2 type names to make a union/,
+      'can throw a proper error without Moose being loaded by the caller' );