summaryrefslogtreecommitdiffstats
path: root/t/21-BUILDARGS.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2010-06-15 03:39:08 -0500
committerJesse Luehrs <doy@tozt.net>2010-06-15 03:39:08 -0500
commitdfc2ff5f2709f198d9fdb21d84a2534acc9f3670 (patch)
tree1e7792b6281cc26c634552d0b3a34ac73653fc62 /t/21-BUILDARGS.t
parenteaf8ccad64a0ca7a5f69ce884753a395f4c196fc (diff)
downloadmoosex-nonmoose-dfc2ff5f2709f198d9fdb21d84a2534acc9f3670.tar.gz
moosex-nonmoose-dfc2ff5f2709f198d9fdb21d84a2534acc9f3670.zip
make more tests use with_immutable
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';