Sha256: 14ae9fb8d9ca39322a9503c6bf04fbf5d074ce6ffcac7dd3e32243d77be6923a

Contents?: true

Size: 567 Bytes

Versions: 15

Compression:

Stored size: 567 Bytes

Contents

class Baza::InfoSqlite3
  attr_reader :db

  def initialize(args = {})
    require "sqlite3" unless RUBY_ENGINE == "jruby"
    require "tmpdir"

    @path = "#{Dir.tmpdir}/baza_sqlite3_test_#{Time.now.to_f.to_s.hash}_#{Random.rand}.sqlite3"
    File.unlink(path) if File.exist?(@path)

    @db = Baza::Db.new({
      type: :sqlite3,
      path: @path,
      index_append_table_name: true,
      sql_to_error: true,
      debug: false
    }.merge(args))
  end

  def before
    @db.tables.list(&:drop)
  end

  def after
    @db.close
    File.unlink(@path)
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
baza-0.0.35 spec/info_sqlite3.rb
baza-0.0.34 spec/info_sqlite3.rb
baza-0.0.33 spec/info_sqlite3.rb
baza-0.0.32 spec/info_sqlite3.rb
baza-0.0.31 spec/info_sqlite3.rb
baza-0.0.30 spec/info_sqlite3.rb
baza-0.0.29 spec/info_sqlite3.rb
baza-0.0.28 spec/info_sqlite3.rb
baza-0.0.27 spec/info_sqlite3.rb
baza-0.0.26 spec/info_sqlite3.rb
baza-0.0.25 spec/info_sqlite3.rb
baza-0.0.24 spec/info_sqlite3.rb
baza-0.0.23 spec/info_sqlite3.rb
baza-0.0.22 spec/info_sqlite3.rb
baza-0.0.21 spec/info_sqlite3.rb