diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-08-17 13:56:59 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-08-17 14:54:34 +0100 |
commit | 25e5b0c4a8d0045715a6ad11e2898585826e4e9b (patch) | |
tree | dad28e05c5b6fee48b32e025b880d5b3144d076f /activerecord/test | |
parent | ff1b0d3c86c2b26470a30a5edb958a365f00098e (diff) | |
download | rails-25e5b0c4a8d0045715a6ad11e2898585826e4e9b.tar.gz rails-25e5b0c4a8d0045715a6ad11e2898585826e4e9b.tar.bz2 rails-25e5b0c4a8d0045715a6ad11e2898585826e4e9b.zip |
Remove support for SQLite 2.
If you're still using it, please install the plugin from git://github.com/rails/sqlite2_adapter.git
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/cases/base_test.rb | 18 | ||||
-rw-r--r-- | activerecord/test/connections/native_sqlite/connection.rb | 25 |
2 files changed, 8 insertions, 35 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 88738d90b1..8421a8fb07 100755 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1775,17 +1775,15 @@ class BasicsTest < ActiveRecord::TestCase assert_equal res4, res5 - unless current_adapter?(:SQLite2Adapter, :DeprecatedSQLiteAdapter) - res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments co WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=co.post_id" - res7 = nil - assert_nothing_raised do - res7 = Post.count(:conditions => "p.#{QUOTED_TYPE} = 'Post' AND p.id=co.post_id", - :joins => "p, comments co", - :select => "p.id", - :distinct => true) - end - assert_equal res6, res7 + res6 = Post.count_by_sql "SELECT COUNT(DISTINCT p.id) FROM posts p, comments co WHERE p.#{QUOTED_TYPE} = 'Post' AND p.id=co.post_id" + res7 = nil + assert_nothing_raised do + res7 = Post.count(:conditions => "p.#{QUOTED_TYPE} = 'Post' AND p.id=co.post_id", + :joins => "p, comments co", + :select => "p.id", + :distinct => true) end + assert_equal res6, res7 end def test_clear_association_cache_stored diff --git a/activerecord/test/connections/native_sqlite/connection.rb b/activerecord/test/connections/native_sqlite/connection.rb deleted file mode 100644 index fea985d8a3..0000000000 --- a/activerecord/test/connections/native_sqlite/connection.rb +++ /dev/null @@ -1,25 +0,0 @@ -print "Using native SQlite\n" -require_dependency 'models/course' -require 'logger' -ActiveRecord::Base.logger = Logger.new("debug.log") - -class SqliteError < StandardError -end - -BASE_DIR = FIXTURES_ROOT -sqlite_test_db = "#{BASE_DIR}/fixture_database.sqlite" -sqlite_test_db2 = "#{BASE_DIR}/fixture_database_2.sqlite" - -def make_connection(clazz, db_file) - ActiveRecord::Base.configurations = { clazz.name => { :adapter => 'sqlite', :database => db_file } } - unless File.exist?(db_file) - puts "SQLite database not found at #{db_file}. Rebuilding it." - sqlite_command = %Q{sqlite "#{db_file}" "create table a (a integer); drop table a;"} - puts "Executing '#{sqlite_command}'" - raise SqliteError.new("Seems that there is no sqlite executable available") unless system(sqlite_command) - end - clazz.establish_connection(clazz.name) -end - -make_connection(ActiveRecord::Base, sqlite_test_db) -make_connection(Course, sqlite_test_db2) |