From 4c5e4fc1911910fc5cdc26f095661212761b09c2 Mon Sep 17 00:00:00 2001 From: Chris Weyl Date: Tue, 23 Dec 2014 18:19:21 -0800 Subject: [PATCH] validate_attribute: use _find_attribute --- lib/Test/Moose/More.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Test/Moose/More.pm b/lib/Test/Moose/More.pm index c02243f..60925f4 100644 --- a/lib/Test/Moose/More.pm +++ b/lib/Test/Moose/More.pm @@ -447,9 +447,8 @@ sub validate_attribute { my ($thing, $name, %opts) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; - has_attribute_ok($thing, $name); - my $att = find_meta($thing)->get_attribute($name) - or return; + return unless has_attribute_ok($thing, $name); + my $att = _find_attribute($thing => $name); return _validate_attribute($att, %opts); }