From dfc2ff5f2709f198d9fdb21d84a2534acc9f3670 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 15 Jun 2010 03:39:08 -0500 Subject: make more tests use with_immutable --- t/21-BUILDARGS.t | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 't/21-BUILDARGS.t') 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'; -- cgit v1.2.3-54-g00ecf