Nathaniel Talbott
9/7/2006 12:36:00 PM
On 9/6/06, Phlip <phlipcpp@yahoo.com> wrote:
> Rubies:
I resemble that remark!
> Could a mixin grant test cases to two concrete classes?
require 'test/unit'
module AbstractSuite
def test_foo
p derive
end
end
class ConcreteSuiteA < Test::Unit::TestCase
include AbstractSuite
def derive
return 'like this'
end
end
class ConcreteSuiteB < Test::Unit::TestCase
include AbstractSuite
def derive
return 'like that'
end
end
Outputs:
Loaded suite t
Started
"like this"
."like that"
.
Finished in 0.000483 seconds.
2 tests, 0 assertions, 0 failures, 0 errors
Which I think is what you're looking for.
HTH,
--
Nathaniel Talbott
<:((><