From acee4d364cdf95e255624863bf6511c02d2f6c21 Mon Sep 17 00:00:00 2001 From: Markus Schirp Date: Mon, 22 Sep 2025 12:55:22 +0000 Subject: [PATCH] Change to simplified test setup * These hooks can just be moved to boot time code without semantic difference reducing indirection. * Makes the effect of the hooks be persisted between parallel exeuction on mutation runs and regular test runs. --- rails_application/test/test_helper.rb | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/rails_application/test/test_helper.rb b/rails_application/test/test_helper.rb index 9037c53f..43466706 100644 --- a/rails_application/test/test_helper.rb +++ b/rails_application/test/test_helper.rb @@ -7,25 +7,12 @@ class InMemoryTestCase < ActiveSupport::TestCase - def before_setup - result = super - @previous_event_store = Rails.configuration.event_store - @previous_command_bus = Rails.configuration.command_bus - Rails.configuration.event_store = Infra::EventStore.in_memory - Rails.configuration.command_bus = Arkency::CommandBus.new - - Configuration.new.call( - Rails.configuration.event_store, Rails.configuration.command_bus - ) - result - end + Rails.configuration.event_store = Infra::EventStore.in_memory + Rails.configuration.command_bus = Arkency::CommandBus.new - def before_teardown - result = super - Rails.configuration.event_store = @previous_event_store - Rails.configuration.command_bus = @previous_command_bus - result - end + Configuration.new.call( + Rails.configuration.event_store, Rails.configuration.command_bus + ) def run_command(command) Rails.configuration.command_bus.call(command)