Alone in the wilderness? Testing plugins with a database

Hi,

I’m one of the developers of a plugin [1] that needs a database for
testing. I’ve been having a miserable time keeping the tests for this
plugin working between Rails versions.

There are a number of guides out there for writing plugins [2], but
few of them cover testing, and those that do stop short of tests
requiring a database.

I’m wondering if anyone can point me to accepted best practices for
testing plugins with a database, or at least working example code. The
setup that we have for our plugin (used to) work great: it would load
the schema and run the tests against three different database
adapters. But now all the callbacks for ActiveRecord objects are being
triggered twice, and the setup is broken in other ways I don’t
understand.

I want to keep supporting and developing this plugin, but I’m feeling
rather stuck at the moment. The code itself works fine, and I’ve got
500+ assertions; I just need a push in the right direction with the
test setup.

Many thanks,
Krishna

[1] http://opensource.symetrie.com/trac/better_nested_set
[2] http://wiki.rubyonrails.org/rails/pages/HowTosPlugins