There are a few:
rake build_frontbase_databases # Build the FrontBase test databases
rake build_mysql_databases # Build the MySQL test databases
rake build_postgresql_databases # Build the PostgreSQL test databases
rake drop_mysql_databases # Drop the MySQL test databases
rake drop_postgresql_databases # Drop the PostgreSQL test databases
rake rebuild_frontbase_databases # Rebuild the FrontBase test databases
rake rebuild_mysql_databases # Rebuild the MySQL test databases
rake rebuild_postgresql_databases # Rebuild the PostgreSQL test databases
I guess the advice in that file should be updated to reflect the rake
tasks we have now.
> I'd be happy to create a patch to make this a bit easier for others in
> the future.
>
> Cheers,
> Jon
>
> >
>
--
Cheers
Koz
If you run the whole test suite via rake test_mysql, it happens
automatically using a dirty trick. If you want to do it manually, you
need to run the file aaa_create_tables_test.rb - the 'aaa' forces the
file to run before all the other tests, ensuring the schema is loaded.
In directory rails/activerecord:
$ ruby -Ilib:test:test/connections/native_mysql test/cases/
aaa_create_tables_test.rb
Using native MySQL
Loaded suite test/cases/aaa_create_tables_test
Started
.-- adapter_name()
-> 0.0000s
-- create_table(:accounts, {:force=>true})
-> 0.0076s
# lots of lines omitted...
-- create_table(:binary_fields, {:options=>"CHARACTER SET
latin1", :force=>true})
-> 0.0074s
.
Finished in 1.067615 seconds.
2 tests, 2 assertions, 0 failures, 0 errors
If you use some other db than mysql, just change the -I option to use
the correct connection file.
RUNNING_UNIT_TESTS needs updating. I was going to do that at one
point but got distracted. If you have time to do a doc patch, I'll +1
it :-)
--
Josh Susser
http://blog.hasmanythrough.com
If you can figure out a nice solution that supports this that would be
fantastic. The only catch I can see to the test helper approach is that
you could be repeatedly testing for the existence or otherwise of those
tables. It's hardly likely to be a performance issue, but it's a little
messy all the same. If you need any help tidying this up, just let us know.
--
Cheers,
Koz