spec/info_sqlite3.rb in baza-0.0.17 vs spec/info_sqlite3.rb in baza-0.0.18

- old
+ new

@@ -1,19 +1,20 @@ class Baza::InfoSqlite3 attr_reader :db - def initialize + def initialize(args = {}) require "sqlite3" unless RUBY_ENGINE == "jruby" require "tmpdir" - @path = "#{Dir.tmpdir}/baza_sqlite3_test_#{Time.now.to_f.to_s.hash}.sqlite3" + @path = "#{Dir.tmpdir}/baza_sqlite3_test_#{Time.now.to_f.to_s.hash}_#{Random.rand}.sqlite3" File.unlink(path) if File.exists?(@path) - @db = Baza::Db.new( + + @db = Baza::Db.new({ type: :sqlite3, path: @path, index_append_table_name: true, sql_to_error: true - ) + }.merge(args)) end def before @db.tables.list.each do |name, table| table.drop