Skip to content

Commit

Permalink
isolate tests with temporary classes
Browse files Browse the repository at this point in the history
  • Loading branch information
machisuke committed Jul 26, 2022
1 parent e81801c commit 011cf97
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@
Dir["spec/support/**/*.rb"].each { |f|
require File.expand_path(f)
}

RSpec.configure do |config|
config.after(:each) do
# To isolate tests with temporary classes.
# ref: https://groups.google.com/g/rspec/c/7CQq0ABS3yQ
if ActiveRecord::VERSION::MAJOR < 7
ActiveSupport::Dependencies::Reference.clear!
end
end
end

0 comments on commit 011cf97

Please sign in to comment.