Sha256: cfa9d3a95b2d47ee4fe3dcd88068bdebdfb82a450d85884d2cb93a2a7bf38c83

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 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 "doesn't mess with timezones"

  it_also 'supports binary upserts'

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
upsert-0.3.2 test/test_sqlite.rb
upsert-0.3.1 test/test_sqlite.rb
upsert-0.3.0 test/test_sqlite.rb
upsert-0.2.2 test/test_sqlite.rb