On Sun, Jul 06, 2003 at 02:05:57AM +0900, Nathaniel Talbott wrote:
> > - Does Test::Unit have any method to test private methods?
>
> Have you tried using Object#send? It completely bypasses all access
> protection.
instance_eval is also extremely useful; it lets you get at instance
variables without accessors, as well as private methods.

class Foo
private
def foo
puts "Got it"
end
end

a = Foo.new
a.foo #=> NameError: private method `foo' called
a.instance_eval { foo } #=> "Got it"