From: Arthur Axel 'fREW' Schmidt Date: Sat, 5 Sep 2009 05:09:06 +0000 (-0500) Subject: initial meta-test conversion X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7905169aa2592de3fb98c172ab95aca9d82f4065;p=gitmo%2FMoose.git initial meta-test conversion --- diff --git a/t/010_basics/001_basic_class_setup.t b/t/010_basics/001_basic_class_setup.t index 00d709c..a184ecd 100644 --- a/t/010_basics/001_basic_class_setup.t +++ b/t/010_basics/001_basic_class_setup.t @@ -2,11 +2,10 @@ use strict; use warnings; - -use Test::More tests => 22; +use lib 'lib', 't/lib'; +use Test::More tests => 23; use Test::Exception; - - +use MetaTest; { package Foo; @@ -14,31 +13,37 @@ use Test::Exception; use Moose::Util::TypeConstraints; } -can_ok('Foo', 'meta'); -isa_ok(Foo->meta, 'Moose::Meta::Class'); +skip_meta { + can_ok('Foo', 'meta'); + isa_ok(Foo->meta, 'Moose::Meta::Class'); +} 2; -ok(Foo->meta->has_method('meta'), '... we got the &meta method'); -ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object'); -dies_ok { - Foo->meta->has_method() -} '... has_method requires an arg'; +meta_can_ok('Foo', 'meta', '... we got the &meta method'); +ok(Foo->isa('Moose::Object'), '... Foo is automagically a Moose::Object'); -dies_ok { - Foo->meta->has_method('') -} '... has_method requires an arg'; +skip_meta { + dies_ok { + Foo->meta->has_method() + } '... has_method requires an arg'; + dies_ok { + Foo->meta->has_method('') + } '... has_method requires an arg'; +} 2; can_ok('Foo', 'does'); -foreach my $function (qw( - extends - has - before after around - blessed confess - type subtype as where - coerce from via - find_type_constraint - )) { - ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method'); -} +skip_meta { + foreach my $function (qw( + extends + has + before after around + blessed confess + type subtype as where + coerce from via + find_type_constraint + )) { + ok(!Foo->meta->has_method($function), '... the meta does not treat "' . $function . '" as a method'); + } +} 15;