Sha256: 54ae8332af4e6048b0111114aaf8a9a0f3ae6b865b307d9884ca41c4c32da011

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'helper'
require 'sqlite3'

db_path = File.expand_path('../../tmp/test.sqlite3', __FILE__)
FileUtils.mkdir_p File.dirname(db_path)
FileUtils.rm_f db_path
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => db_path

describe Upsert::SQLite3_Database do
  before do
    @opened_connections = []
    ActiveRecord::Base.connection.drop_table(Pet.table_name) rescue nil
    Pet.auto_upgrade!
    # @connection = new_connection
  end
  # after do
  #   @opened_connections.each { |c| c.close }
  # end

  # def new_connection
  #   c = SQLite3::Database.open(File.expand_path('../../tmp/test.sqlite3', __FILE__))
  #   @opened_connections << c
  #   c
  # end
  def connection
    # @connection
    ActiveRecord::Base.connection
  end

  it_also 'is a database with an upsert trick'

  it_also 'is just as correct as other ways'

  it_also 'can be speeded up with upserting'

  it_also 'supports multibyte'

  it_also 'is thread-safe'

  it_also 'is precise'

  it_also "doesn't mess with timezones"

  it_also 'supports binary upserts'

  # it_also "doesn't blow up on reserved words"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upsert-0.3.4 test/test_sqlite.rb
upsert-0.3.3 test/test_sqlite.rb