开发者

can't get test unit startup to work in ruby 1.9.2

开发者 https://www.devze.com 2023-04-11 00:11 出处:网络
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:

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 featu开发者_开发百科re, other than scattered posts here on SO and the like.

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

TIA


Ruby 1.9.x bundles minitest not Test::Unit. Test::Unit bundled in Ruby 1.8.x had not been improved but unbundled Test::Unit (test-unit 2) will be improved actively.

So you must be using the Test::Unit gem? Is it perhaps an older version which doesn't support this feature?


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

0

精彩评论

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