summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-03-02 00:43:25 -0600
committerJesse Luehrs <doy@tozt.net>2011-03-02 00:43:25 -0600
commitdc072f08418d6b918bd35c97a1884298de5dfdaf (patch)
treea9637986986d8e56c2458655ff75f22ff08ab8b8 /t
parent483965342b368093c04e5d5e2bbf4b0c2c610ebb (diff)
downloadmoosex-nonmoose-dc072f08418d6b918bd35c97a1884298de5dfdaf.tar.gz
moosex-nonmoose-dc072f08418d6b918bd35c97a1884298de5dfdaf.zip
warn instead of die if the superclass has a DESTROY but no new
Diffstat (limited to 't')
-rw-r--r--t/26-no-new-constructor-error.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/26-no-new-constructor-error.t b/t/26-no-new-constructor-error.t
new file mode 100644
index 0000000..e70442e
--- /dev/null
+++ b/t/26-no-new-constructor-error.t
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package NonMoose;
+ sub create { bless {}, shift }
+ sub DESTROY { }
+}
+
+{
+ package Child;
+ use Moose;
+ use MooseX::NonMoose;
+ extends 'NonMoose';
+ {
+ my $warning;
+ local $SIG{__WARN__} = sub { $warning = $_[0] };
+ __PACKAGE__->meta->make_immutable;
+ ::like($warning, qr/Not inlining.*doesn't contain a 'new' method/,
+ "warning when trying to make_immutable without a superclass 'new'");
+ }
+}
+
+done_testing;