Sha256: f56dfcf8d6404b83c11fea2a715bed42ff4ef0d7d65e792be15866d412cb8b9f
Contents?: true
Size: 1 KB
Versions: 15
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true require "active_mocker/loaded_mocks" require "active_mocker/rspec" RSpec.configure do |config| config.include ActiveMocker::Rspec config.before(:each, active_mocker: true) do unless ENV["RUN_WITH_RAILS"] && self.class.metadata[:rails_compatible] active_mocker.mocks.each { |class_name, mock| stub_const(class_name, mock) } end if (mapping = active_mocker.features[:stub_active_record_exceptions]) mapping.each { |class_name, mock| stub_const(class_name, mock) } end end config.after(:all, active_mocker: true) do ActiveMocker::LoadedMocks.delete_all end config.before(:all, active_mocker: true) do ActiveMocker::LoadedMocks.delete_all end config.after(:each, active_mocker: true) do ActiveMocker::LoadedMocks.delete_all if active_mocker.features[:delete_all_before_example] end config.before(:each, active_mocker: true) do ActiveMocker::LoadedMocks.delete_all if active_mocker.features[:delete_all_before_example] end end
Version data entries
15 entries across 15 versions & 1 rubygems