From: PerfectDayToChaseTornados Date: 2007-03-28T07:30:12+09:00 Subject: Re: temporarily change method access for test "Kyle Schmitt" wrote in message news:2b548b8b0703271337n7d1a5badsa8c4f221d4c9f3b2@mail.gmail.com... > Private methods? > Hum. Never saw a use for them in my stuff.. anyway > > http://www.rubycentral.com/faq/rubyfaq-7.html and > http://www.rubycentral.com/faq/rubyfaq-8.html > > will tell you. > > But something like this will work > > class J > def ack() > puts "be nimble" > end > def ill() > puts "went up the hill" > end > private :ack > end > > j=J.new > > j.ill > went up the hill > > j.ack > NoMethodError: private method `ack' called for # > > class < public :ack > end > > j.ack > be nimble Thanks!! I figured out I can do it using send as well :-) I like my unit testing to be quite fine grained & so do like to test complex private methods :-) -- pdtct