Permalink
Browse files

Fix jruby support, and also support tests in jruby with mysql

  • Loading branch information...
1 parent 0a58da3 commit 313d52143de4bfbc27635fecba61c35c87d2b9cf @mattconnolly mattconnolly committed Dec 8, 2012
Showing with 14 additions and 6 deletions.
  1. +2 −0 Gemfile
  2. +8 −0 config/database.yml
  3. +2 −0 spec/unit/daemon/database_reconnectable_spec.rb
  4. +2 −6 spec/unit_spec_helper.rb
View
@@ -21,6 +21,8 @@ end
platform :jruby do
gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcpostgresql-adapter'
+ gem 'activerecord-jdbcmysql-adapter'
+ gem 'activerecord-jdbcsqlite3-adapter'
gem 'jdbc-postgres'
gem 'jruby-openssl'
end
View
@@ -29,3 +29,11 @@ mysql2:
username: rapns_test
password: ""
encoding: utf8
+
+jdbcmysql:
+ adapter: jdbcmysql
+ database: rapns_test
+ host: localhost
+ username: rapns_test
+ password: ""
+ encoding: utf8
@@ -30,6 +30,8 @@ def perform
Mysql2::Error
when 'jdbcpostgresql'
ActiveRecord::JDBCError
+ when 'jdbcmysql'
+ ActiveRecord::JDBCError
else
raise "Please update #{__FILE__} for adapter #{$adapter}"
end
View
@@ -12,12 +12,8 @@
jruby = defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
-$adapter = ENV['ADAPTER'] ||
- if jruby
- 'jdbcpostgresql'
- else
- 'postgresql'
- end
+$adapter = ENV['ADAPTER'] || 'postgresql'
+$adapter = 'jdbc' + $adapter if jruby
DATABASE_CONFIG = YAML.load_file(File.expand_path("../config/database.yml", File.dirname(__FILE__)))

0 comments on commit 313d521

Please sign in to comment.