Permalink
Browse files

Make everything run with JRuby too

  • Loading branch information...
1 parent 650c982 commit c7f990dc0855adf0d24b7b60d5981a8d827b8e0d @aslakhellesoy committed Aug 30, 2009
Showing with 64 additions and 25 deletions.
  1. +0 −22 config/database.yml
  2. +29 −0 config/database_jdbcmysql.yml
  3. +17 −0 config/database_sqlite3.yml
  4. +18 −3 lib/tasks/cucumber_test.rake
View
@@ -1,22 +0,0 @@
-# SQLite version 3.x
-# gem install sqlite3-ruby (not necessary on OS X Leopard)
-development:
- adapter: sqlite3
- database: db/development.sqlite3
- pool: 5
- timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
-test:
- adapter: sqlite3
- database: db/test.sqlite3
- pool: 5
- timeout: 5000
-
-production:
- adapter: sqlite3
- database: db/production.sqlite3
- pool: 5
- timeout: 5000
@@ -0,0 +1,29 @@
+development:
+ adapter: jdbcmysql
+ encoding: utf8
+ reconnect: false
+ database: cucumber_development
+ pool: 5
+ username: root
+ password:
+ socket: /tmp/mysql.sock
+
+test:
+ adapter: jdbcmysql
+ encoding: utf8
+ reconnect: false
+ database: cucumber_test
+ pool: 5
+ username: root
+ password:
+ socket: /tmp/mysql.sock
+
+production:
+ adapter: jdbcmysql
+ encoding: utf8
+ reconnect: false
+ database: cucumber_production
+ pool: 5
+ username: root
+ password:
+ socket: /tmp/mysql.sock
@@ -0,0 +1,17 @@
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+test:
+ adapter: sqlite3
+ database: db/test.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: sqlite3
+ database: db/production.sqlite3
+ pool: 5
+ timeout: 5000
@@ -7,9 +7,16 @@ namespace :cucumber_test do
rails_tags.each do |tag|
namespace tag do
desc "Test with Rails #{tag}"
- task :test => [:banner, :clobber, :checkout, :install,
- :generate_feature, :generate_scaffold,
- :migrate] do
+ task :test => [
+ :banner,
+ :clobber,
+ :checkout,
+ :database_yml,
+ :install,
+ :generate_feature,
+ :generate_scaffold,
+ :migrate
+ ] do
# The cucumber task doesn't exist a priori, so we execute it here.
sh "#{$0} cucumber:all"
end
@@ -31,6 +38,14 @@ namespace :cucumber_test do
end
end
+ task :database_yml do
+ if defined?(JRUBY_VERSION)
+ cp 'congig/database_jdbcmysql.yml', 'congig/database.yml'
+ else
+ cp 'congig/database_sqlite3.yml', 'congig/database.yml'
+ end
+ end
+
task :install do
sh "script/generate cucumber #{ENV['CUCUMBER_GENERATE_OPTS']}"
end

0 comments on commit c7f990d

Please sign in to comment.