summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/50-buggy-constructor-inlining.t26
1 files changed, 9 insertions, 17 deletions
diff --git a/t/50-buggy-constructor-inlining.t b/t/50-buggy-constructor-inlining.t
index c72c7c8..253ff03 100644
--- a/t/50-buggy-constructor-inlining.t
+++ b/t/50-buggy-constructor-inlining.t
@@ -2,8 +2,9 @@
use strict;
use warnings;
use Test::More tests => 6;
+use Test::Moose qw(with_immutable);
-my ($Foo, $Bar, $Baz) = (0, 0, 0);
+my ($Foo, $Bar, $Baz);
{
package Foo;
sub new { $Foo++; bless {}, shift }
@@ -25,19 +26,10 @@ my ($Foo, $Bar, $Baz) = (0, 0, 0);
sub BUILD { $Baz++ }
}
-Baz->new;
-is($Foo, 1, "Foo->new is called");
-{ local $TODO = "need to call non-Moose constructor, not superclass constructor";
-is($Bar, 0, "Bar->new is not called");
-}
-is($Baz, 1, "Baz->new is called");
-
-Baz->meta->make_immutable;
-($Foo, $Bar, $Baz) = (0, 0, 0);
-
-Baz->new;
-is($Foo, 1, "Foo->new is called");
-{ local $TODO = "need to call non-Moose constructor, not superclass constructor";
-is($Bar, 0, "Bar->new is not called");
-}
-is($Baz, 1, "Baz->new is called");
+with_immutable {
+ ($Foo, $Bar, $Baz) = (0, 0, 0);
+ Baz->new;
+ is($Foo, 1, "Foo->new is called once");
+ is($Bar, 1, "Bar->BUILD is called once");
+ is($Baz, 1, "Baz->BUILD is called once");
+} 'Baz';