Sha256: 97951eba09af02aa6c97785f8b66a426bbd930127c61dcb8fc9a0b835b5300d8

Contents?: true

Size: 484 Bytes

Versions: 12

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

if defined? JRUBY_VERSION
  USING_JRUBY = true
else
  USING_JRUBY = false
end

if USING_JRUBY
  SEQUEL_TEST_DB_URI = 'jdbc:sqlite::memory:'
else
  SEQUEL_TEST_DB_URI = 'sqlite::memory'
end

DB = Sequel.connect(SEQUEL_TEST_DB_URI)

def seed(db = DB)
  db.run('CREATE TABLE users (id INTEGER PRIMARY KEY, name STRING)')

  db[:users].insert(id: 1, name: 'Jane')
  db[:users].insert(id: 2, name: 'Joe')
end

def deseed(db = DB)
  db.drop_table? :users
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.6.4 lib/rom/sql/spec/support.rb
rom-sql-3.6.3 lib/rom/sql/spec/support.rb
rom-sql-3.6.2 lib/rom/sql/spec/support.rb
rom-sql-3.6.1 lib/rom/sql/spec/support.rb
rom-sql-3.6.0 lib/rom/sql/spec/support.rb
rom-sql-3.5.0 lib/rom/sql/spec/support.rb
rom-sql-3.4.0 lib/rom/sql/spec/support.rb
rom-sql-3.3.3 lib/rom/sql/spec/support.rb
rom-sql-3.3.2 lib/rom/sql/spec/support.rb
rom-sql-3.3.1 lib/rom/sql/spec/support.rb
rom-sql-3.3.0 lib/rom/sql/spec/support.rb
rom-sql-3.2.0 lib/rom/sql/spec/support.rb