views:

41

answers:

1

In Ruby unit testing can I run a test class from another class

for exa

class Foo < Test::Unit:: TestCase

test_abc()
test_bnd()

Now i want to run this above test suite from my main class

so how could i do it I tried using runner but dono wat should be argument to the run method

Test::Unit::UI::Console::TestRunner.run(FOO)

, Regards

A: 

That is correct(refer http://www.ensta.fr/~diam/ruby/online/ruby-doc-stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html)

require 'test/unit/ui/console/testrunner'
Test::Unit::UI::Console::TestRunner.run(TC_MyTest)
HN