diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/connections/native_sqlite3/in_memory_connection.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/connections/native_sqlite3/in_memory_connection.rb b/activerecord/test/connections/native_sqlite3/in_memory_connection.rb new file mode 100644 index 0000000000..d11a5fe8c8 --- /dev/null +++ b/activerecord/test/connections/native_sqlite3/in_memory_connection.rb @@ -0,0 +1,17 @@ +print "Using native SQLite3\n" +require 'fixtures/course' +require 'logger' +ActiveRecord::Base.logger = Logger.new("debug.log") + +class SqliteError < StandardError +end + +def make_connection(clazz, db_definitions_file) + clazz.establish_connection(:adapter => 'sqlite3', :dbfile => ':memory:') + File.read("#{File.dirname(__FILE__)}/../../fixtures/db_definitions/#{db_definitions_file}").split(';').each do |command| + clazz.connection.execute(command) unless command.strip.empty? + end +end + +make_connection(ActiveRecord::Base, 'sqlite.sql') +make_connection(Course, 'sqlite2.sql') |