Try copying this [1] into your lib/tasks directory. It switches the db:test:prepare to use migrations to create the test database.
[1]: http://svn.caldersphere.net/svn/main/plugins/migrate_testdb/tasks/migrate_testdb.rake /Nick On 9/25/07, Raphaël Valyi <[EMAIL PROTECTED]> wrote: > Hi, > > After installing the rspec Rails plugin, I can run rspec on a specific test > file, this runs fine. > But I'm unnable to run the rake rspec file: > Indeed, if I do: > rake rspec, I get: > Task not supported by 'jdbc' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:146:in > `raise' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/rails.rb:4:in > `call' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rake- > 0.7.3/lib/rake.rb:392:in `execute' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in > `each' > ... > > > Looking at gems/rails-1.2.3/lib/tasks/databases.rake, this doesn't surprise > me: in the purge task, there is a > case abcs[Rcase > abcs[RAILS_ENV]["adapter"]AILS_ENV]["adapter"] > that test the adapter delared in the database.yml config file. > it can match "mysql", "oracle" and others but it will never match "jdbc" > which is the adapter you should writte in database.yml to use AR-JDBC. > > So what can we do? Which one should we patch? I mean, yes I can patch my > case abcs[RAILS_ENV]["adapter"], but this is totally hugly. Is that really > sustainable to declare a 'jdbc' adapter? > > If ever I patch those lines to go further I still get a bug later on: > NativeException: java.sql.SQLException: Incorrect database name '': DROP > DATABASE IF EXISTS `` > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/ActiveRecord- > JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:550:in > `log_no_bench' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/active_record/connection_adapters/jdbc_adapter.rb:471:in > `execute' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/jdbc_adapter/jdbc_mysql.rb:115:in > `drop_database' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/ActiveRecord-JDBC-0.5/lib/jdbc_adapter/jdbc_mysql.rb:106:in > `recreate_database' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/databases.rake:120:in > `recreate_database' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/rails.rb:4:in > `call' > /home/rvalyi/DEV/jruby/lib/ruby/gems/1.8/gems/rake- > 0.7.3/lib/rake.rb:392:in `execute' > > Again I suspect the database.yml is not anymore what is expected (I'm using > MySQL, SQL should pass). But I could be wrong on that last one. > So anybody having rspec running without problem with JRuby, any hint? > > Many thanks, > > Raphaël Valyi > > > PS: to test rspec I installed things as described here: > http://www.railsforum.com/viewtopic.php?pid=35774 in > the third post. > I'm on JRuby trunk but I think it's unrelated to JRuby (more likely to > AR-JDBC integration). > > _______________________________________________ > Jruby-extras-devel mailing list > [email protected] > http://rubyforge.org/mailman/listinfo/jruby-extras-devel > _______________________________________________ Jruby-extras-devel mailing list [email protected] http://rubyforge.org/mailman/listinfo/jruby-extras-devel
