Singleton objects were not singletons when made immutable. We need to
authorDave Rolsky <autarch@urth.org>
Wed, 5 Mar 2008 04:23:57 +0000 (04:23 +0000)
committerDave Rolsky <autarch@urth.org>
Wed, 5 Mar 2008 04:23:57 +0000 (04:23 +0000)
commit2b4ce4bdb3bda617f7d2a966609c38ceb790d66e
tree4b1fd60876eb2b5a4ba4625cc51ec27f10664175
parent553b1b2b47f55ea6c5651d10fc79e14f9a1992a0
Singleton objects were not singletons when made immutable. We need to
provide a custom Meta::Method::Constructor so the generated immtable
new() method respects singleton-ness.

This test implements this, along with tests.

Finally, it adds no Moose at the end of all the classes to prevent any
conflicts between Moose's exports and the class's methods. This was a
problem in Meta::Class, where the exported make_immutable was
overriding the one provided by Moose::Meta::Class.
ChangeLog
lib/MooseX/Singleton.pm
lib/MooseX/Singleton/Meta/Class.pm
lib/MooseX/Singleton/Meta/Instance.pm
lib/MooseX/Singleton/Meta/Method/Constructor.pm [new file with mode: 0644]
lib/MooseX/Singleton/Object.pm
t/001-basic.t
t/003-immutable.t [new file with mode: 0644]