From: Yuval Kogman Date: Sun, 27 Jan 2008 15:49:11 +0000 (+0000) Subject: finish get_attribute_values etc X-Git-Tag: 0_53~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=361c5bc4c9e1dc0f1d8e64bb649396b124b4c55d;p=gitmo%2FClass-MOP.git finish get_attribute_values etc --- diff --git a/lib/Class/MOP/Class.pm b/lib/Class/MOP/Class.pm index 2e51b9f..a58766f 100644 --- a/lib/Class/MOP/Class.pm +++ b/lib/Class/MOP/Class.pm @@ -439,7 +439,7 @@ sub get_attribute_values { return +{ map { $_->name => $_->get_value($instance) } grep { $_->has_value($instance) } - $self->>compute_all_applicable_attributes + $self->compute_all_applicable_attributes }; } diff --git a/t/010_self_introspection.t b/t/010_self_introspection.t index 2c9e9a7..da2f3a8 100644 --- a/t/010_self_introspection.t +++ b/t/010_self_introspection.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 205; +use Test::More tests => 209; use Test::Exception; BEGIN { @@ -59,6 +59,7 @@ my @class_mop_class_methods = qw( instance_metaclass get_meta_instance new_object clone_object + get_attribute_values get_init_args construct_instance construct_class_instance clone_instance rebless_instance check_metaclass_compatability diff --git a/t/023_attribute_get_read_write.t b/t/023_attribute_get_read_write.t index 0b490bb..dc8c2e0 100644 --- a/t/023_attribute_get_read_write.t +++ b/t/023_attribute_get_read_write.t @@ -117,7 +117,7 @@ my $foo = bless {}, 'Foo'; $foo->set_bar(1); $foo->baz(10); -is_deeply($foo->meta->get_meta_instance->get_all_slot_values($foo), { +is_deeply($foo->meta->get_attribute_values($foo), { bar => 1, baz => 10, }); @@ -125,13 +125,13 @@ is_deeply($foo->meta->get_meta_instance->get_all_slot_values($foo), { my $bar = bless {}, 'Bar'; $bar->set_bar(99); -is_deeply($bar->meta->get_meta_instance->get_all_slot_values($bar), { +is_deeply($bar->meta->get_attribute_values($bar), { bar => 99, }); $bar->quux(1337); -is_deeply($bar->meta->get_meta_instance->get_all_slot_values($bar), { +is_deeply($bar->meta->get_attribute_values($bar), { bar => 99, quux => 1337, });