From: Ricardo SIGNES Date: Mon, 4 Feb 2008 03:17:30 +0000 (+0000) Subject: give the initializer a test X-Git-Tag: 0_53~8^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed8563cb907724e79a4d7b1d7480562def691981;p=gitmo%2FClass-MOP.git give the initializer a test --- diff --git a/lib/Class/MOP/Instance.pm b/lib/Class/MOP/Instance.pm index 9aa3f33..d1ed877 100644 --- a/lib/Class/MOP/Instance.pm +++ b/lib/Class/MOP/Instance.pm @@ -89,7 +89,7 @@ sub _set_initial_slot_value { }; # most things will just want to set a value, so make it first arg - $instance->$initializer($value, $callback); + $instance->$initializer($value, $slot_name, $callback); } sub initialize_slot { diff --git a/t/024_attribute_initializer.t b/t/024_attribute_initializer.t index 76e5834..cf39b7a 100644 --- a/t/024_attribute_initializer.t +++ b/t/024_attribute_initializer.t @@ -25,7 +25,7 @@ This checks that the initializer is used to set the initial value. reader => 'get_bar', writer => 'set_bar', initializer => sub { - my ($self, $value, $callback) = @_; + my ($self, $value, $name, $callback) = @_; $callback->($value * 2); }, );