Module: TemporaryModel::TestHelper
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/temporary_model/test_helper.rb
Instance Method Summary collapse
-
#run ⇒ Object
Override ActiveSupport::TestCase#run.
Instance Method Details
#run ⇒ Object
Override ActiveSupport::TestCase#run
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/temporary_model/test_helper.rb', line 18 def run self.class.temporary_classes.each do |temporary_class| create_temporary_table temporary_class.table_name, &temporary_class.define_table end super ensure TemporaryModel::Record.connection.disable_referential_integrity do self.class.temporary_classes.each do |temporary_class| drop_temporary_table temporary_class.table_name Object.send(:remove_const, temporary_class.name) end end end |