Sha256: b7b05c28337811b0e0476d915ef34b2489fd5ecae4ab939c9505a0f49f61c54b
Contents?: true
Size: 677 Bytes
Versions: 21
Compression:
Stored size: 677 Bytes
Contents
require 'spec_helper' require 'rails' def unit_example?(metadata) metadata[:file_path] =~ %r{spec/unit} end RSpec.configure do |config| config.before(:each) do Modis.with_connection do |redis| redis.keys('rpush:*').each { |key| redis.del(key) } end if redis? if active_record? && unit_example?(self.class.metadata) connection = ActiveRecord::Base.connection connection.begin_transaction joinable: false end end config.after(:each) do if active_record? && unit_example?(self.class.metadata) connection = ActiveRecord::Base.connection connection.rollback_transaction if connection.transaction_open? end end end
Version data entries
21 entries across 21 versions & 2 rubygems