Plugins - Foreign Key Fixtures
Add to favoritesForeignKeyFixtures
============
This plugin inserts a method into the lifecycle of a TestCase in order to clean up fixture data between different TestCase classes. This happens because the base fixtures facilities purge previous data and insert new data at the same time at when the TestCase first loads up. For example:
TestCase1 < Test::Unit::TestCase
fixtures :testa, :testb
end
TestCase2 < Test::Unit:TestCase
fixtures :testa
end
Where testb has a foreign key that depends upon testa, the second TestCase will fail since it will only try to delete from table testa and there are records in table testb that depend on testa.
This plugin fixes that by hooking into the end of the run method of TestSuite and deleting the fixture data. Therefore, no data stays around between the running of TestCase1 and TestCase2.
