Sha256: b342359751331d1752eac2da3c36ba688ee1627aa38433c80284bc442f934d65
Contents?: true
Size: 1.15 KB
Versions: 16
Compression:
Stored size: 1.15 KB
Contents
module Ardb module AdapterSpy def self.new(&block) block ||= proc{ } record_spy = Class.new{ include Ardb::AdapterSpy } record_spy.class_eval(&block) record_spy end def self.included(klass) klass.class_eval do include InstanceMethods end end module InstanceMethods attr_accessor :drop_tables_called_count, :load_schema_called_count attr_accessor :drop_db_called_count, :create_db_called_count def drop_tables_called_count @drop_tables_called_count ||= 0 end def drop_tables(*args, &block) self.drop_tables_called_count += 1 end def load_schema_called_count @load_schema_called_count ||= 0 end def load_schema(*args, &block) self.load_schema_called_count += 1 end def drop_db_called_count @drop_db_called_count ||= 0 end def drop_db(*args, &block) self.drop_db_called_count += 1 end def create_db_called_count @create_db_called_count ||= 0 end def create_db(*args, &block) self.create_db_called_count += 1 end end end end
Version data entries
16 entries across 16 versions & 1 rubygems