From: PerfectDayToChaseTornados Date: 2007-03-28T08:05:10+09:00 Subject: Re: temporarily change method access for test "Kyle Schmitt" wrote in message news:2b548b8b0703271338x69e330b5r106e54cbeadbab2d@mail.gmail.com... > On 3/27/07, Phrogz wrote: >> Perhaps: >> >> C:\>qri Module.public >> ---------------------------------------------------------- >> Module#public >> public => self >> public(symbol, ...) => self >> ------------------------------------------------------------------------ >> With no arguments, sets the default visibility for subsequently >> defined methods to public. With arguments, sets the named methods >> to have public visibility. > Ohh that's so much cooler than what I woulda done. > Did find that in the Ruby book, but couldn't really figure out how to use it ;-) Bit of a Ruby newbie, many years Java, but not many days Ruby yet? Could you give me an example? I'm sure I've seen an example somewhere of a unit test that temporarily made the method in the class it was testing public, but only during the scope of the test block/method (can't remember which). I thought it was a really cool way to do it ;-) Thanks -- pdtct