From 83f7cd2cfadeffe711a275472975bbe247bea8af Mon Sep 17 00:00:00 2001 From: doy Date: Sat, 11 Apr 2009 18:04:49 -0500 Subject: use has_method rather than get_method for testing for existence --- t/005-moose.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/005-moose.t') diff --git a/t/005-moose.t b/t/005-moose.t index 86578cb..c6c6ac8 100644 --- a/t/005-moose.t +++ b/t/005-moose.t @@ -20,7 +20,7 @@ package main; my $foo_sub = Foo::Sub->new; isa_ok $foo_sub, 'Foo'; is $foo_sub->foo, 'FOO', 'inheritance works'; -is(Foo::Sub->meta->get_method('new'), undef, +ok(!Foo::Sub->meta->has_method('new'), 'Foo::Sub doesn\'t have its own new method'); $_->meta->make_immutable for qw(Foo Foo::Sub); @@ -28,7 +28,7 @@ $_->meta->make_immutable for qw(Foo Foo::Sub); $foo_sub = Foo::Sub->new; isa_ok $foo_sub, 'Foo'; is $foo_sub->foo, 'FOO', 'inheritance works (immutable)'; -is(Foo::Sub->meta->get_method('new'), undef, +ok(!Foo::Sub->meta->has_method('new'), 'Foo::Sub doesn\'t have its own new method (immutable)'); package Foo::OtherSub; @@ -40,7 +40,7 @@ package main; my $foo_othersub = Foo::OtherSub->new; isa_ok $foo_othersub, 'Foo'; is $foo_othersub->foo, 'FOO', 'inheritance works (immutable when extending)'; -ok(Foo::OtherSub->meta->get_method('new'), +ok(Foo::OtherSub->meta->has_method('new'), 'Foo::OtherSub has its own inlined constructor (immutable when extending)'); ok(!(Foo::OtherSub->meta->get_method('new')->can('does_role') && Foo::OtherSub->meta->get_method('new')->does_role('MooseX::NonMoose::Meta::Role::Constructor')), @@ -50,7 +50,7 @@ Foo::OtherSub->meta->make_immutable; $foo_othersub = Foo::OtherSub->new; isa_ok $foo_othersub, 'Foo'; is $foo_othersub->foo, 'FOO', 'inheritance works (all immutable)'; -ok(Foo::OtherSub->meta->get_method('new'), +ok(Foo::OtherSub->meta->has_method('new'), 'Foo::OtherSub has its own inlined constructor (immutable when extending)'); ok(!(Foo::OtherSub->meta->get_method('new')->can('does_role') && Foo::OtherSub->meta->get_method('new')->does_role('MooseX::NonMoose::Meta::Role::Constructor')), -- cgit v1.2.3-54-g00ecf