I browsed the previous thread about this topic – I’m in favor of
Test::Unit determining that a TestCase class has empty tests and calling
that a failure – but in some cases I have superclasses with shared
fixture code and intentionally no test methods of their own, yet
Test::Unit still complains about these:
C:\Temp>more whack.rb
require 'test/unit'
class MyBaseFixture < Test::Unit::TestCase
def setup
puts 'setup'
end
end
class MyTestCase < MyBaseFixture
def test_me
assert(1 == 1)
end
end
C:\Temp>whack.rb
Loaded suite C:/Temp/whack
Started
setup
Fsetup
.
Finished in 0.0 seconds.
1) Failure!!!
default_test(MyBaseFixture)
[c:/ruby/lib/ruby/site_ruby/1.8/test/unit/testcase.r
b:97]:
No tests were specified
2 tests, 2 assertions, 1 failures, 0 errors
I know I could redesign my stuff to not use inheritence here, but I’d
prefer to only see a failure raised if I have an empty test:
class MyTestCase < …
def test_this
end
end
… but not an empty class …
class MyBaseClass < …
end
Thoughts?
···
–
Chris
http://clabs.org/blogki
-=-=-=-=-=-=-=-=-=-=-=-=-=-
Free solo piano album (mp3)
http://cministries.org/cstudios/blackandwhite.htm