Sha256: 136f5b423fddf40b4502a4e09d31db5031aa17cf81185cc435eaa3d37bd671bb

Contents?: true

Size: 452 Bytes

Versions: 4

Compression:

Stored size: 452 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
rom-sql-0.3.0 lib/rom/sql/spec/support.rb
rom-sql-0.2.0 lib/rom/sql/spec/support.rb
rom-sql-0.1.1 lib/rom/sql/spec/support.rb
rom-sql-0.1.0 lib/rom/sql/spec/support.rb