On 2 Nov 2005, at 19:21, Russel Winder wrote:
>> For unit testing you can still set a predefined MetaClass which
>> allows
>> that.
>
> Apologies I haven't been able to follow this discussion in detail
> but it
> strikes me that Groovy now has a full MOP basically a la
> Smalltalk. Is
> this right or have I misinterpreted?
Well, you can replace the standard MetaClass for an arbitrary class
with an arbitrary MetaClass. This is new and is only in CVS HEAD.
This has been discuss-wed on this list but it's easy to miss stuff:)
Look for the thread "One MataClass or many?" staring on 18th October.
I'm nervous about claiming that anything is just like Smalltalk -
that's fighting talk for some folk;)
>
> There will have to be some pages on how to do this testing. I suspect
> that Groovy's ability to test private methods could be a good angle
> for
> Groovy in this niche area.
Yes - whilst you can do this now by writing your own MetaClass it'd a
bit of a pain. I'm in the middle of a major MetaClass restructure and
at the end of that we should have the tools to make a custom
metaClass which exposes private methods a trivial matter.
John Wilson
The Wilson Partnership
http://www.wilson.co.uk