can't get test unit startup to work in ruby 1.

2020-07-11 01:54发布

I am using Ruby 1.9.2 (ruby -v yields :ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]), and I am trying to get this to work:

require 'test/unit'

class TestStartup < Test::Unit::TestCase
  def self.startup
    puts "startup"
  end
  def test1
    puts "in test1"
  end
end 

when I run it, I get

Loaded suite test_startup
Started
in test1
.
Finished in 0.000395 seconds. 


1 tests, 0 assertions, 0 failures, 0 errors, 0 skips

I had a hard time finding documentation on this feature, other than scattered posts here on SO and the like.

And yes, I want to use this feature and not setup.

TIA

2条回答
▲ chillily
2楼-- · 2020-07-11 02:37

Ruby 1.9.2 uses Minitest instead of Test::Unit by default, so it might be that this feature is missing from Minitest.

查看更多
聊天终结者
3楼-- · 2020-07-11 02:55
登录 后发表回答