From: Brian Candler Date: 2007-03-28T06:18:17+09:00 Subject: Re: temporarily change method access for test On Wed, Mar 28, 2007 at 05:25:08AM +0900, PerfectDayToChaseTornados wrote: > Hi All, > > I have seen an example of a unit test temporarily making a private method > public to unit test it. Now that I need it I can't find it :-) Please could > someone kindly point me in the right direction? You can always bypass the checks using instance_eval. That allows you to directly access instance variables of the object too. class Foo private def hello puts "gotcha" end end a = Foo.new a.instance_eval { hello }