Hello,
I have a similar problem/confusion. My assertions are contained in
instance methods of classes defined in an external file - so I don't
think the suggestion below is applicable - at least it didn't work
when I tried it. The page I'm testing has 4 forms - forms 1 and 4 are
nearly identical
This is a hard problem, that i'm still looking for a good answer.
I've spent time investigating it. The problem is that there are two
different versions of add_assertion, the method that updates the assertion
count.
One of them is in Test::Unit::TestCase -- and it is what you get if you do
I suggest that you put your library methods in a Module. Thus:
# library.rb
module MyLibrary
def my_library_method(arg)
# code...
end
end
# tests.rb
require 'test/unit'
require 'library.rb'
class TC1 Test::Unit::TestCase
include MyLibrary
def test_method
my_library_method