[rspec-users] specs on private methods

Ben Mabey ben at benmabey.com
Tue Jan 8 14:36:52 EST 2008


Yes.  http://eigenclass.org/hiki/Changes+in+Ruby+1.9#l24

Tim Harper wrote:
> Doesn't 1.9 allow you to call obj.send!, which will allow you to  
> access private methods?
>
> Tim
>
> On Jan 8, 2008, at 12:27 PM, Scott Taylor wrote:
>
>   
>> On Jan 8, 2008, at 2:20 PM, Ben Mabey wrote:
>>
>>     
>>> Chris Olsen wrote:
>>>       
>>>> How does a person test private methods?
>>>>
>>>> Is there a way to declare them as private, but retain any tests that
>>>> were written during the initial development?
>>>>
>>>> Thanks.
>>>>
>>>>         
>>> When I need to do this I just use the send method.
>>>       
>> But it will break in 1.9 and on!  (That's why Jay Fields didn't do it
>> in his post).
>>
>> Scott
>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/rspec-users
>>     
>
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>   



More information about the rspec-users mailing list