# Problems with super

**URL:** <https://www.ruby-forum.com/t/problems-with-super/83004>\
**Category:** Ruby\
**Created:** [January 23, 2007, 12:10am UTC](https://www.ruby-forum.com/t/problems-with-super/83004 "2007-01-23T00:10:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijaynyayapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b2d939/32.png) [@vijaynyayapati](https://www.ruby-forum.com/u/vijaynyayapati)\
**Post date:** [January 23, 2007, 12:10am UTC](https://www.ruby-forum.com/t/problems-with-super/83004/1 "2007-01-23T00:10:10Z")

</div>

Hi,

I have been struggling to get super to work.

I have a class A which inherits from Test::Unit::UI::Console::TestRunner

class A has a method ‘start’ which is trying to override the ‘start’  
method from the TestRunner class.

so my derived class looks like

require ‘test::unit::ui::console::testrunner’

class A \< Test::Unit::UI::Console::TestRunner  
def start  
super

# some code here

end  
end

I am running some tests using the Test::Unit framework.

Now, whenever a testsuite runs, i would like the start method from class  
A to be invoked when required. Currently, the base class is getting  
invoked, which means the start method in the base class is not getting  
overridden.

How do i get the start method from class A to get invoked instead of the  
start method in the TestRunner class?

Help!

---

<div class="post-metadata">

**Author:** ![vijaynyayapati](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b2d939/32.png) [@vijaynyayapati](https://www.ruby-forum.com/u/vijaynyayapati)\
**Post date:** [January 23, 2007, 1:48am UTC](https://www.ruby-forum.com/t/problems-with-super/83004/2 "2007-01-23T01:48:30Z")

</div>

Vijay Nyayapati wrote:

> require ‘test::unit::ui::console::testrunner’
> 
> class A \< Test::Unit::UI::Console::TestRunner  
> def start  
> super
> 
> # some code here
> 
> end  
> end

Try…

class Test::Unit::UI::Console::TestRunner  
alias super\_start start  
def start  
super\_super  
# some code here  
end

T.
