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