I
Ian Macdonald
Hello,
I have some unit tests that I'm having a little trouble with.
This is basically the set-up:
class TC_Foo < Test::Unit::TestCase
def setup
...
end
def test_method1
...
end
def test_method2
...
end
end
class TC_Bar < TC_Foo
def setup
...
end
def test_method1
...
end
# TC_foo#method2 will get called for
end
All the tests for TC_Foo work as expected. The problem comes with
TC_Bar. I want TC_Bar#setup to be called prior to each of the unit tests
in that class, but I can't seem to make that happen. Instead,
TC_Foo#setup is called, which is not what I want at all.
I've tried explicitly undefining the setup method in TC_Bar with
'undef_method :setup', but even that doesn't work.
There must be a way to do this, right?
Ian
--
Ian Macdonald | The clothes have no emperor. -- C.A.R.
System Administrator | Hoare, commenting on ADA.
(e-mail address removed) |
http://www.caliban.org |
|
I have some unit tests that I'm having a little trouble with.
This is basically the set-up:
class TC_Foo < Test::Unit::TestCase
def setup
...
end
def test_method1
...
end
def test_method2
...
end
end
class TC_Bar < TC_Foo
def setup
...
end
def test_method1
...
end
# TC_foo#method2 will get called for
end
All the tests for TC_Foo work as expected. The problem comes with
TC_Bar. I want TC_Bar#setup to be called prior to each of the unit tests
in that class, but I can't seem to make that happen. Instead,
TC_Foo#setup is called, which is not what I want at all.
I've tried explicitly undefining the setup method in TC_Bar with
'undef_method :setup', but even that doesn't work.
There must be a way to do this, right?
Ian
--
Ian Macdonald | The clothes have no emperor. -- C.A.R.
System Administrator | Hoare, commenting on ADA.
(e-mail address removed) |
http://www.caliban.org |
|