X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F103_Perl6Attribute_test.t;h=4c0b3dd5a1a15a42b66c81c537a3386831a2eb06;hb=a3ca9754e1937ec96c99f56223c5f243b48779a3;hp=8ad155ce3263dc25c7f710c36a370cb784a0ffa9;hpb=c9e77dbb017258dc44295fc4ec8e0bdd99ec9361;p=gitmo%2FClass-MOP.git diff --git a/t/103_Perl6Attribute_test.t b/t/103_Perl6Attribute_test.t index 8ad155c..4c0b3dd 100644 --- a/t/103_Perl6Attribute_test.t +++ b/t/103_Perl6Attribute_test.t @@ -1,29 +1,28 @@ -#!/usr/bin/perl - use strict; use warnings; -use Test::More tests => 10; +use Test::More; use File::Spec; -BEGIN { - use_ok('Class::MOP'); - require_ok(File::Spec->catdir('examples', 'Perl6Attribute.pod')); +use Class::MOP; + +BEGIN { + require_ok(File::Spec->catfile('examples', 'Perl6Attribute.pod')); } { package Foo; - + use metaclass; - + Foo->meta->add_attribute(Perl6Attribute->new('$.foo')); - Foo->meta->add_attribute(Perl6Attribute->new('@.bar')); - Foo->meta->add_attribute(Perl6Attribute->new('%.baz')); - + Foo->meta->add_attribute(Perl6Attribute->new('@.bar')); + Foo->meta->add_attribute(Perl6Attribute->new('%.baz')); + sub new { my $class = shift; - bless $class->meta->construct_instance(@_) => $class; - } + $class->meta->new_object(@_); + } } my $foo = Foo->new(); @@ -40,3 +39,5 @@ is($foo->foo, 42, '... Foo.foo == 42'); is_deeply($foo->bar, [], '... Foo.bar == []'); is_deeply($foo->baz, {}, '... Foo.baz == {}'); + +done_testing;