module DbBackupTool
  module TestHelper
    module MapperHelpers
      
      def active_record_mapper
        config = { adapter: 'sqlite3', database: ':memory:' }
        Mappers::ActiveRecordMapper.new(config)
      end
      
      def active_record_mapper_with_schema
        mapper = active_record_mapper
        
        ActiveRecord::Schema.define do
          @connection = mapper.connection
          create_table :members do |t|
            t.string :name
            t.integer :gender_id
          end
        end
        
        mapper
      end
      
    end
  end
end