From: matz@... (Yukihiro Matsumoto) Date: 2003-12-11T12:43:52+09:00 Subject: Re: How to unit test finalizers? Hi, In message "How to unit test finalizers?" on 03/12/11, Samuel Tesla writes: |> Nothing. There's no way to "ensure" instance to be GC'ed except for |> program termination. That's a weak (or charm) point of Ruby's GC. | |That's fine. I'm guessing that the GC will eventually, most likely, |collect those references. The question then becomes, how can I |reliably unit test my finalizer code if I can't reliably get it to |execute? How about not relying on finalizers, i.e. separate finalizing process into a method, then call the method explicitly in the test? You don't have to test whether finalizers are called. That's my responsibility. matz.