Permalink
Browse files

Default to jdbc memory database in sqlite specs if running on jruby

  • Loading branch information...
1 parent 69c1991 commit 90d084dda3fbfa807a5841cb60ab0bf5fd859dff @jeremyevans committed Jun 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 spec/adapters/sqlite_spec.rb
@@ -1,7 +1,13 @@
require File.join(File.dirname(File.expand_path(__FILE__)), 'spec_helper.rb')
unless defined?(SQLITE_DB)
- SQLITE_URL = 'sqlite:/' unless defined? SQLITE_URL
+ unless defined? SQLITE_URL
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
+ SQLITE_URL = 'jdbc:sqlite::memory:'
+ else
+ SQLITE_URL = 'sqlite:/'
+ end
+ end
SQLITE_DB = Sequel.connect(ENV['SEQUEL_SQLITE_SPEC_DB']||SQLITE_URL)
end
INTEGRATION_DB = SQLITE_DB unless defined?(INTEGRATION_DB)

0 comments on commit 90d084d

Please sign in to comment.