[rspec-users] Monitor method invoking from superclass

David Chelimsky dchelimsky at gmail.com
Thu Sep 30 09:45:54 EDT 2010


On Sep 30, 2010, at 8:20 AM, Zhi-Qiang Lei wrote:

> On Sep 30, 2010, at 9:15 PM, David Chelimsky wrote:
> 
>> On Sep 30, 2010, at 7:45 AM, Zhi-Qiang Lei wrote:
>> 
>>> On Sep 30, 2010, at 7:59 PM, David Chelimsky wrote:
>>> 
>>>> On Sep 30, 2010, at 4:02 AM, Zhi-Qiang Lei wrote:
>>>> 
>>>>> Dear All,
>>>>> 
>>>>> Class B is a subclass of class A. Could anyone tell me how to monitor if object created from class B receives a super message when its method is invoked. Thanks.
>>>> 
>>>> I don't know of a way to do that. What problem are you trying to solve?
>> 
>> [ I moved your post to the bottom. Please post at the bottom or in-line]
>> 
>>> Class A
>>> def a
>>>  #some code
>>> end
>>> end
>>> 
>>> Class B
>>> def a
>>>  #some code
>>>  super
>>> end
>>> end
>>> 
>>> I want to if B is receive 'super' message. Thanks.
>> 
>> I understand what you meant, but I don't understand why you want to do this. What is the bigger problem you are trying to solve? Why do you want to monitor when super gets called?
> 
> Thank you. Actually what I want is just to write a test case for it, with rspec.

You can not.

Good luck,
David


More information about the rspec-users mailing list