Sha256: bbbb3964c373d5bdaf32094f85b159748cc8f2e63ee474267cdb628c991a8487
Contents?: true
Size: 672 Bytes
Versions: 11
Compression:
Stored size: 672 Bytes
Contents
require 'sqlite3' require 'dbi' require 'active_record' module Daru::RSpec class Account < ActiveRecord::Base self.table_name = 'accounts' end end shared_context 'with accounts table in sqlite3 database' do let(:db_name) do 'daru_test' end before do # just in case FileUtils.rm(db_name) if File.file?(db_name) SQLite3::Database.new(db_name).tap do |db| db.execute "create table accounts(id integer, name varchar, age integer, primary key(id))" db.execute "insert into accounts values(1, 'Homer', 20)" db.execute "insert into accounts values(2, 'Marge', 30)" end end after do FileUtils.rm(db_name) end end
Version data entries
11 entries across 11 versions & 1 rubygems