spec/support/app_integration.rb in hanami-2.0.0.beta1.1 vs spec/support/app_integration.rb in hanami-2.0.0.beta2

- old
+ new

@@ -18,11 +18,11 @@ end end end RSpec.shared_context "Application integration" do - let(:application_modules) { %i[TestApp Admin Main Search] } + let(:app_modules) { %i[TestApp Admin Main Search] } end RSpec.configure do |config| config.include RSpec::Support::Files, :app_integration config.include RSpec::Support::WithTmpDirectory, :app_integration @@ -50,13 +50,12 @@ end Zeitwerk::ExplicitNamespace.cpaths.clear Zeitwerk::ExplicitNamespace.tracer.disable - if Hanami.instance_variable_defined?(:@_app) - Hanami.remove_instance_variable(:@_app) - end + Hanami.instance_variable_set(:@_bundled, {}) + Hanami.remove_instance_variable(:@_app) if Hanami.instance_variable_defined?(:@_app) $LOAD_PATH.replace(@load_paths) # Remove example-specific LOADED_FEATURES added when running each example new_features_to_keep = ($LOADED_FEATURES - @loaded_features).tap { |feats| @@ -66,10 +65,10 @@ path.include?(Dir.tmpdir) end } $LOADED_FEATURES.replace(@loaded_features + new_features_to_keep) - application_modules.each do |app_module_name| + app_modules.each do |app_module_name| next unless Object.const_defined?(app_module_name) Object.const_get(app_module_name).tap do |mod| mod.constants.each do |name| mod.send(:remove_const, name)