diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-24 12:02:40 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-01-24 12:02:40 +0000 |
commit | f08bd27398f11420a2bae5ac0be5f169650683a6 (patch) | |
tree | 728833c4c8094cfde32d3b17fc449a3cbd31f27b /actionpack | |
parent | bb778fcf179fb440dc33c6446da72f0d95b58180 (diff) | |
download | rails-f08bd27398f11420a2bae5ac0be5f169650683a6.tar.gz rails-f08bd27398f11420a2bae5ac0be5f169650683a6.tar.bz2 rails-f08bd27398f11420a2bae5ac0be5f169650683a6.zip |
Pass busy timeout for sqlite3 integration tests.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6029 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/test/active_record_unit.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/actionpack/test/active_record_unit.rb b/actionpack/test/active_record_unit.rb index fd29126354..5f2745b593 100644 --- a/actionpack/test/active_record_unit.rb +++ b/actionpack/test/active_record_unit.rb @@ -51,22 +51,23 @@ class ActiveRecordTestConnector def setup_connection if Object.const_defined?(:ActiveRecord) + defaults = { :database => ':memory:' } begin - connection_options = {:adapter => 'sqlite3', :dbfile => ':memory:'} - ActiveRecord::Base.establish_connection(connection_options) - ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => connection_options } + options = defaults.merge :adapter => 'sqlite3', :timeout => 500 + ActiveRecord::Base.establish_connection(options) + ActiveRecord::Base.configurations = { 'sqlite3_ar_integration' => options } ActiveRecord::Base.connection rescue Exception # errors from establishing a connection $stderr.puts 'SQLite 3 unavailable; trying SQLite 2.' - connection_options = {:adapter => 'sqlite', :dbfile => ':memory:'} - ActiveRecord::Base.establish_connection(connection_options) - ActiveRecord::Base.configurations = { 'sqlite2_ar_integration' => connection_options } + options = defaults.merge :adapter => 'sqlite' + ActiveRecord::Base.establish_connection(options) + ActiveRecord::Base.configurations = { 'sqlite2_ar_integration' => options } ActiveRecord::Base.connection end Object.send(:const_set, :QUOTED_TYPE, ActiveRecord::Base.connection.quote_column_name('type')) unless Object.const_defined?(:QUOTED_TYPE) else - raise "Couldn't locate ActiveRecord." + raise "Can't setup connection since ActiveRecord isn't loaded." end end @@ -83,7 +84,7 @@ class ActiveRecordTestConnector end end -# Test case for inheiritance +# Test case for inheritance class ActiveRecordTestCase < Test::Unit::TestCase # Set our fixture path if ActiveRecordTestConnector.able_to_connect |