summaryrefslogtreecommitdiff
path: root/t/bugs/create_anon_role_pass.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/bugs/create_anon_role_pass.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/bugs/create_anon_role_pass.t')
-rw-r--r--t/bugs/create_anon_role_pass.t39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/bugs/create_anon_role_pass.t b/t/bugs/create_anon_role_pass.t
new file mode 100644
index 0000000..1e28d76
--- /dev/null
+++ b/t/bugs/create_anon_role_pass.t
@@ -0,0 +1,39 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+use Moose ();
+
+use lib 't/lib';
+
+{
+ package t::bugs::Bar;
+ use Moose;
+
+ # empty class.
+
+ no Moose;
+ __PACKAGE__->meta->make_immutable();
+
+ 1;
+}
+
+my $meta;
+use Data::Dumper;
+isnt ( exception {
+ $meta = Moose::Meta::Class->create_anon_class(
+ superclasses => [ 't::bugs::Bar', ], # any old class will work
+ roles => [ 'Role::BreakOnLoad', ],
+ )
+}, undef, 'Class dies when attempting composition');
+
+my $except;
+isnt ( $except = exception {
+ $meta = Moose::Meta::Class->create_anon_class(
+ superclasses => [ 't::bugs::Bar', ],
+ roles => [ 'Role::BreakOnLoad', ],
+ );
+}, undef, 'Class continues to die when attempting composition');
+
+done_testing;