summaryrefslogtreecommitdiffstats
path: root/t/21-BUILDARGS.t
diff options
context:
space:
mode:
Diffstat (limited to 't/21-BUILDARGS.t')
-rw-r--r--t/21-BUILDARGS.t13
1 files changed, 6 insertions, 7 deletions
diff --git a/t/21-BUILDARGS.t b/t/21-BUILDARGS.t
index d6aa973..4fed2a7 100644
--- a/t/21-BUILDARGS.t
+++ b/t/21-BUILDARGS.t
@@ -2,6 +2,7 @@
use strict;
use warnings;
use Test::More tests => 4;
+use Test::Moose;
package Foo;
@@ -30,10 +31,8 @@ sub BUILDARGS {
package main;
-my $foo = Foo::Moose->new('bar', foo => 'baz');
-is($foo->name, 'bar', 'superclass constructor gets the right args');
-is($foo->foo, 'baz', 'subclass constructor gets the right args');
-Foo::Moose->meta->make_immutable;
-$foo = Foo::Moose->new('bar', foo => 'baz');
-is($foo->name, 'bar', 'superclass constructor gets the right args (immutable)');
-is($foo->foo, 'baz', 'subclass constructor gets the right args (immutable)');
+with_immutable {
+ my $foo = Foo::Moose->new('bar', foo => 'baz');
+ is($foo->name, 'bar', 'superclass constructor gets the right args');
+ is($foo->foo, 'baz', 'subclass constructor gets the right args');
+} 'Foo::Moose';