Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 604
user119282 Avatar asked Oct 03 '11 19:10

user119282


2 Answers

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?

like image 167
Andy Waite Avatar answered Oct 20 '22 16:10

Andy Waite


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

like image 37
tadman Avatar answered Oct 20 '22 16:10

tadman