Sha256: 24228645edc55cc5052fe0d5bda6b04a647af9b2aa2bd5684521b75b9e8e93ab
Contents?: true
Size: 895 Bytes
Versions: 2
Compression:
Stored size: 895 Bytes
Contents
require 'rubygems' unless Object.const_defined?('Sequel') $:.unshift(File.join(File.dirname(__FILE__), "../lib/")) require 'sequel_core' end if File.exists?(File.join(File.dirname(__FILE__), 'spec_config.rb')) require File.join(File.dirname(__FILE__), 'spec_config.rb') end class MockDataset < Sequel::Dataset def insert(*args) @db.execute insert_sql(*args) end def update(*args) @db.execute update_sql(*args) end def fetch_rows(sql) @db.execute(sql) yield({:id => 1, :x => 1}) end end class MockDatabase < Sequel::Database attr_reader :sqls def execute(sql) @sqls ||= [] @sqls << sql end def reset @sqls = [] end def transaction; yield; end def dataset; MockDataset.new(self); end end class SchemaDummyDatabase < Sequel::Database attr_reader :sqls def execute(sql) @sqls ||= [] @sqls << sql end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sequel_core-1.5.0 | spec/spec_helper.rb |
sequel_core-1.5.1 | spec/spec_helper.rb |