Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use validate_class, not thing, when checking attribute composition in…

…side validate_class()

Using validate_thing() was preventing our '-isa' options from being acted on.
  • Loading branch information...
commit 4720d47fa5f1cfd9f6892b8b1eae63550905df1c 1 parent 8c8bdcd
Chris Weyl authored
3  lib/Test/Moose/More.pm
View
@@ -423,7 +423,8 @@ sub _validate_attribute {
sort keys %opts
;
- validate_thing $att => %thing_opts
+ ### %thing_opts
+ validate_class $att => %thing_opts
if keys %thing_opts;
return _attribute_options_ok($att, %opts);
3  t/validate_attribute.t
View
@@ -29,6 +29,9 @@ note 'validate attribute validation';
{
my ($_ok, $_nok, $_skip) = counters();
test_out $_ok->('TestClass has an attribute named foo');
+ test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 has a metaclass});
+ test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 is a Moose class});
+ test_out $_ok->('The object isa Moose::Meta::Attribute');
test_out $_ok->('Moose::Meta::Class::__ANON__::SERIAL::1 does TestRole');
test_out $_ok->('foo has a builder');
test_out $_ok->('foo option builder correct');
2  t/validate_class.t
View
@@ -103,6 +103,8 @@ note 'validate w/attribute validation';
test_out $_ok->('TestClass has an attribute named baz');
do {
my ($_ok, $_nok, $_skip, $_plan) = counters(1);
+ test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 has a metaclass});
+ test_out $_ok->(q{Moose::Meta::Class::__ANON__::SERIAL::1 is a Moose class});
test_out $_ok->(q{TestClass's attribute baz does TestRole::Two});
test_out $_ok->(q{TestClass's attribute baz has a reader});
test_out $_ok->(q{TestClass's attribute baz option reader correct});
Please sign in to comment.
Something went wrong with that request. Please try again.