开发者

Ruby unit test :run a test class from the main class

开发者 https://www.devze.com 2023-01-07 15:08 出处:网络
In Ruby unit testing can I run a test class from another class for 开发者_如何学JAVAexa class Foo < Test::Unit:: TestCase

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

for 开发者_如何学JAVAexa

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


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)
0

精彩评论

暂无评论...
验证码 换一张
取 消