From 6790e4dd2acc797c727d9c1787bc6756b02a5cd9 Mon Sep 17 00:00:00 2001 From: Eric Proulx Date: Sun, 15 Dec 2024 16:03:04 +0100 Subject: [PATCH] Add `deregister in `before(:all)`` --- spec/spec_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 26d3d4aa5..9340f0d83 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,7 +17,7 @@ # so it should be set to true here as well to reflect that. I18n.enforce_available_locales = true -Grape::Util::Registry.include(Deregister) + RSpec.configure do |config| config.include Rack::Test::Methods @@ -25,7 +25,10 @@ config.raise_errors_for_deprecations! config.filter_run_when_matching :focus - config.before(:all) { Grape::Util::InheritableSetting.reset_global! } + config.before(:all) do + Grape::Util::InheritableSetting.reset_global! + Grape::Util::Registry.include(Deregister) + end config.before { Grape::Util::InheritableSetting.reset_global! } # Enable flags like --only-failures and --next-failure