Sha256: 6f9af1b66bf1c635d0260c118afc6dadea307c5cf84afe9ae89771a204806743
Contents?: true
Size: 481 Bytes
Versions: 27
Compression:
Stored size: 481 Bytes
Contents
CassandraObject::Base.class_eval do class_attribute :created_records self.created_records = [] after_create do created_records << self end def self.delete_after_test # created_records.reject(&:destroyed?).each(&:destroy) Issue.delete_all created_records.clear end end module ActiveSupport class TestCase teardown do if CassandraObject::Base.created_records.any? CassandraObject::Base.delete_after_test end end end end
Version data entries
27 entries across 27 versions & 2 rubygems