views:

249

answers:

1

I'm trying to test a plugin that i wrote by running:

rake spec:plugins

When i execute this command it appears that it drops my database tables (in my test DB) and then runs a migration without any plugins loaded to give me a clean database. This would normally be fine, but I am using a plugin that allows me to set index length limits for MYSQL, so if I run a migration without that plugin, then i get a syntax error. This means that i cannot test my plugin with the rspec rake command.

I can't find any documentation for this command, is there a way to get it to not run any migrations before it executes?

+1  A: 

Try setting this in your plugin spec:

Spec::Runner.configure do |config|
  config.use_transactional_fixtures = false
end

Of course this means you have to ensure the test DB is in the correct state for your tests, and that you clean up any modifications on exit.

zetetic
Thanks for the reply, i eventually just gave up and ran that spec file directly.
ThinkBohemian